[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NS runtime feature detection

From: Charles A. Roelli
Subject: Re: NS runtime feature detection
Date: Mon, 24 Jul 2017 21:02:57 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

Thanks for taking the initiative with this.  Maybe it's time to open a bug?

When I try to compile with the patch applied, with this block:

@@ -7349,7 +7365,11 @@ - (void)windowDidEnterFullScreen /* provided for direct calls */
       BOOL tbar_visible = FRAME_EXTERNAL_TOOL_BAR (emacsframe) ? YES : NO;
+      /* These two values are only defined in 10.7 and above. */
+      int NSApplicationPresentationFullScreen = (1 << 10);
+      int NSApplicationPresentationAutoHideToolbar = (1 << 11);
       unsigned val = (unsigned)[NSApp presentationOptions];

while building with:

./configure --with-ns --enable-macos-runtime-feature-detection && make

I got these errors:

nsterm.m: In function ‘-[EmacsView windowDidEnterFullScreen]’:
nsterm.m:7395: error: ‘NSApplicationPresentationFullScreen’ undeclared (first use in this function)
nsterm.m:7395: error: (Each undeclared identifier is reported only once
nsterm.m:7395: error: for each function it appears in.)
nsterm.m:7396: error: ‘NSApplicationPresentationAutoHideToolbar’ undeclared (first use in this function)

(line numbers are off due to an intervening commit)

I'm confused why the macro call you wrote doesn't prevent this. 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...

On 23/07/2017 14:17, Alan Third wrote:
On Sat, Jul 22, 2017 at 12:22:30PM +0100, Alan Third wrote:
Or perhaps we provide a flag that enables a universal binary build
that doesn’t bother about hiding the warnings?
Attached is a first attempt at this in nsterm.m. I think I’ve got
everything, but there may be some new variables and things defined
that I’ve missed which will throw up errors in older macOS versions.

It seems ‘universal binary’ means something specific, so I went with a
different name.


     ./configure --with-ns --enable-macos-runtime-feature-detection

It will give a lot of deprecation and unknown method warnings, but
hopefully that’s all.

If you build normally there should be no (new) warnings or errors.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]