GNOME Bugzilla – Bug 780019
gtk+3 3.22.10 does not compile on macOS Yosemite
Last modified: 2017-03-15 11:26:29 UTC
Freshly released gtk+3 3.22.10 does not compile on macOS Yosemite. The error is the following: CC gdkwindow-quartz.lo gdkwindow-quartz.c:2499:7: error: use of undeclared identifier 'NSWindowStyleMask' NSWindowStyleMask mask = [impl->toplevel styleMask]; This is due to this recent commit: https://git.gnome.org/browse/gtk+/commit/?h=gtk-3-22&id=7160e3a12f56ab52ea3e0ff2097b8912128a3677 NSWindowStyleMask is an AppKit type, so I guess the file is missing: #include <AppKit/AppKit.h>
Created attachment 347944 [details] [review] quartz: fix build for <10.12 The style mask type was changed from NSUInteger to NSWindowStyleMask. Use NSUInteger so it also works on older macOS.
(In reply to Christoph Reiter (lazka) from comment #1) > Created attachment 347944 [details] [review] [review] > quartz: fix build for <10.12 > > The style mask type was changed from NSUInteger to NSWindowStyleMask. > Use NSUInteger so it also works on older macOS. I am not sure that will be sufficient to fix this. The NSWindowStyleMask enum constants (https://developer.apple.com/reference/appkit/nswindowstylemask?language=objc) are also new in 10.12, so you will need to #define them when #ifdef AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER is not met.
It build fine here using 10.11 with xcode 7. As far as I can see the code doesn't use any of the new constants.
Sorry about that, I thought the new enum constants were used...
Review of attachment 347944 [details] [review]: Sorry about that.
Attachment 347944 [details] pushed as 64ec7c2 - quartz: fix build for <10.12