GNOME Bugzilla – Bug 780300
gio/gosxappinfo.c uses deprecated LSFindApplicationForInfo
Last modified: 2017-04-27 13:35:59 UTC
Building glib-2.52.0 on OS X 10.11 gives a warning: gosxappinfo.c:315:7: warning: 'LSFindApplicationForInfo' is deprecated: first deprecated in macOS 10.10 - Use LSCopyApplicationURLsForBundleIdentifier instead. [-Wdeprecated-declarations] if (LSFindApplicationForInfo (kLSUnknownCreator, bundle_id, NULL, NULL, &app_url)) ^ /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSInfoDeprecated.h:785:1: note: 'LSFindApplicationForInfo' has been explicitly marked deprecated here LSFindApplicationForInfo( ^
It already does: #ifdef AVAILABLE_MAC_OS_VERSION_10_10_OR_LATER ... #else if (LSFindApplicationForInfo (kLSUnknownCreator, bundle_id, NULL, NULL, &app_url)) #endif
I'm on 10.11, which is later than 10.10. By the warning, it's clear the compiler is *not* using that "10.10 or later" code block.
Ah, it's the wrong macro. Should be: #ifdef AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER (missing _X_, and uses _AND_ not _OR_)
...fixing which leads to build failure: gosxappinfo.c:303:3: error: unknown type name 'CSArrayRef'; did you mean 'CFArrayRef'? CSArrayRef urls = LSCopyApplicationURLsForBundleIdentifier (bundle_id, NULL); ^~~~~~~~~~ CFArrayRef /System/Library/Frameworks/CoreFoundation.framework/Headers/CFArray.h:108:59: note: 'CFArrayRef' declared here typedef const struct CF_BRIDGED_TYPE(NSArray) __CFArray * CFArrayRef; ^ 1 error generated. make[4]: *** [Makefile:3829: libgio_2_0_la-gosxappinfo.lo] Error 1
Clearly just a typo.
Created attachment 349021 [details] [review] gosxappinfo: Fix typo in ifdef
(In reply to Patrick Griffis (tingping) from comment #6) > Created attachment 349021 [details] [review] [review] > gosxappinfo: Fix typo in ifdef Seems to do the right thing on 10.11 now. Thanks!
Review of attachment 349021 [details] [review]: good catch!
Attachment 349021 [details] pushed as f3321da - gosxappinfo: Fix typo in ifdef