|
From: | Anders Lindgren |
Subject: | bug#27810: NS runtime feature detection |
Date: | Tue, 1 Aug 2017 17:38:03 +0200 |
Shouldn't MIN_ALLOWED be MIN_REQUIRED? As in here:
+#if defined (NS_IMPL_COCOA) \
+ && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
+#if MAC_OS_X_VERSION_MIN_ALLOWED < MAC_OS_X_VERSION_10_7
There are a few more places that have a MIN_ALLOWED thing. This
always trips me up, so I'm not sure.
And also, it's apparently feasible to do a runtime check for a
specific macOS, according to this:
https://developer.apple.com/library/content/documentation/De veloperTools/Conceptual/cross_ development/Using/using.html#/ /apple_ref/doc/uid/20002000- SW7
which mentions APPKIT_EXTERN double NSAppKitVersionNumber. I'm not
sure if they still define this on Sierra, though. But if they do,
then we can use this to fix the nsmenu.m problem.
On 26/07/2017 23:57, Alan Third wrote:
On Mon, Jul 24, 2017 at 09:44:04PM +0100, Alan Third wrote:
I think I finally worked it out by reading macfont.m. I’ve attachedI'm confused why the macro call you wrote doesn't prevent this. ButI’m unclear where we should be using MIN_REQUIRED vs MAX_ALLOWED, but
when I change it to #if MAC_OS_X_VERSION_MIN_ALLOWED <=
MAC_OS_X_VERSION_10_6, then it compiles. This min/max stuff always
confuses me...
I think we’re OK with MAX everywhere for what we’re doing. I’ve just
used MAX in both my new macros.
YET ANOTHER version of this which doesn't use any custom macros.
To compile for multiple versions you do something like:
./configure --with-ns CFLAGS="-DMAC_OS_X_VERSION_MIN_REQUIRED=1070 -DMAC_OS_X_VERSION_MAX_ALLOWED =101200 -g -O3"
By default max and min are set to the version you’re running on,
afaict. Please be aware that 10.6 isn’t fully compatible with this at
the moment, as there is at least one place (nsmenu.m:535) where
there’s a bug fix for it that I can’t see an immediate way of making
dynamic.
Additionally the native fullscreen stuff is based on a simple check
against MAX. I expect I’ll be able to fix that with a bit of work,
though.
I’d be interested to see if this builds on systems lower than 10.10
with the above configure command. There are probably bits and pieces
I’ve not quite got right.
[Prev in Thread] | Current Thread | [Next in Thread] |