After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 727366 - gtkapplication-quartz-menu.c fails to compile
gtkapplication-quartz-menu.c fails to compile
Status: RESOLVED OBSOLETE
Product: gtk-mac-integration
Classification: Other
Component: General
2.0.x
Other Mac OS
: Normal major
: ---
Assigned To: GTK Mac Integration Maintainers
GTK Mac Integration Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-03-30 21:46 UTC by Partha
Modified: 2019-02-22 05:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patchfile (935 bytes, patch)
2014-05-15 09:49 UTC, Frederic Devernay
none Details | Review

Description Partha 2014-03-30 21:46:03 UTC
Compiling gtk+-3.12.0 on an Mavericks with minimum-version=10.6 against 10.6 SDK.

Got the following stopper:

gtkapplication-quartz-menu.c:265:46: warning: instance method '-backingScaleFactor' not found (return type defaults to 'id') [-Wobjc-method-access]
      scale = roundf ([[NSScreen mainScreen] backingScaleFactor]);
                                             ^~~~~~~~~~~~~~~~~~
/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSScreen.h:16:12: note: receiver is instance of class declared here
@interface NSScreen : NSObject {
           ^
gtkapplication-quartz-menu.c:265:23: error: passing 'id' to parameter of incompatible type 'float'
      scale = roundf ([[NSScreen mainScreen] backingScaleFactor]);
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Developer/SDKs/MacOSX10.6.sdk/usr/include/architecture/i386/math.h:382:29: note: passing argument to parameter here
extern float roundf ( float );
                            ^
1 warning and 1 error generated.
make[4]: *** [libgtk_3_la-gtkapplication-quartz-menu.lo] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Comment 1 John Ralls 2014-03-30 23:56:48 UTC
What version of Xcode are you using?
Comment 2 Partha 2014-03-31 00:06:44 UTC
I build from the command line. I have the latest Xcode installed but don't use it. I point my build to /Developer/SDks (see above). gcc is 4.2.1

Hope that helps.

Thanks,
Partha
Comment 3 Partha 2014-03-31 00:09:30 UTC
Also, I am not sure why the bug report is attached to gtk-mac-integration?
Comment 4 John Ralls 2014-03-31 01:08:33 UTC
(In reply to comment #3)
> Also, I am not sure why the bug report is attached to gtk-mac-integration?

I misread the "gtkapplication" as "gtkosxapplication"

(In reply to comment #2)
> I build from the command line. I have the latest Xcode installed but don't use
> it. I point my build to /Developer/SDks (see above). gcc is 4.2.1

Where did /Developer/SDKs and gcc 4.2.1 come from? They're not standard issue on Mavericks.
Comment 5 Partha 2014-03-31 02:02:56 UTC
The SDKs are left over from Snow-Leopard and also because I try to build Gimp et al that is compatible with Snow Leopard and above.

OK, you got me on the 4.2.1 issue. :)

gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix
Comment 6 John Ralls 2014-03-31 03:35:19 UTC
That's why I asked which version of Xcode. Unless you build your own compiler, the compiler tracks the Xcode version.

I haven't tried anything with 5.1, never mind SDK 10.6. I usually use either Xcode-3.2 or 4.1 and SDK 10.5 (which I know doesn't work well with LLVM) for backwards compatibility. You can get both from the Apple Developer site. You don't need to have a paid account for access, a free one will work fine.

None of which says anything about the validity of your bug; I just need to nail down how you got there to avoid a lot of flailing trying to reproduce it.
Comment 7 Partha 2014-03-31 09:39:42 UTC
Thanks for your comments John.

Just as Fyi - I have both accounts with Apple. I have built all the dependencies for Gimp for some time now with the above compiler. gtk+ 2.24.23, glib etc. build just fine within my setup. You can get my version of Gimp (McGimp) from my website.

Previously, I also tried to build 3.11.5 with Xcode 3.2.1 under Snow Leopard ( I have it installed on an external USB drive) and it's the same issue as above.

The last version that built correctly was 3.11.2 since gtkapplication-quartz-menu.c didn't exist then.
Comment 8 Clemens Lang 2014-04-08 14:42:29 UTC
This also occurs on 10.6 with Xcode 3.2.6: https://trac.macports.org/ticket/43283. I guess a configure check needs to be added?
Comment 9 David Evans 2014-04-12 00:41:27 UTC
As shown above and in the referenced MacPorts ticket, the problem is that
the  backingScaleFactor method is not available for OS X 10.6 -- it was introduced in 10.7.  Something like this should work:

#ifdef __APPLE__
#include <Availability.h>
#if __MAC_OS_X_VERSION_MIN_REQUIRED <= 1060

code for 10.6 and earlier

#else

existing code for 10.7 and later

#endif
#endif
Comment 10 Frederic Devernay 2014-05-15 09:49:04 UTC
Created attachment 276584 [details] [review]
patchfile

This patch enables compilation with the 10.6 SDK, and if running on 10.7 it properly gets the backingScaleFactor property. If running on 10.6 or below, scale is set to 1.
Comment 11 John Ralls 2018-03-20 23:47:58 UTC
Gtk-mac-integration no longer supports ancient versions of MacOS X, so this is obsolete.