-
Notifications
You must be signed in to change notification settings - Fork 38.7k
OS X 10.10: LSSharedFileListItemResolve() is deprecated #5477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OS X 10.10: LSSharedFileListItemResolve() is deprecated #5477
Conversation
|
Check the travis build: it seems that the travis build jumps into the Testes on OSX 10.10. Build works fine. Will build and test on 10.9 after you made Travis happy. |
|
@jonasschnelli Can you please test on 10.9 even now? Maybe this is bug in how travis builds... |
|
Just built on a official OSX 10.9. Works fine. No more warning. It doesn't look that the open-source implementations where up to date up till 10.9,10.10. |
|
Tested on OSX 10.9 and 10.10. ACK. |
|
NACK. This needs to be a bit more complicated, I'm afraid. There are a few things to keep in mind about the sdk versioning. Mainly, the SDK used for building, and the one used (by the user on a different machine) at runtime. To simplify, I'll expand on the two most extreme scenarios.
We can build against 10.7 sdk (as we currently do for releases, with -mmacosx-version-min=10.6) such that old versions are still supported, and new features are used if they're detected at runtime. When we bump to newer SDKs or change mmacosx-version-min, everything continues to work as intended. Something like this should cover all cases, I believe (untested, may need an AvailabilityMacros.h include): #ifndef NSAppKitVersionNumber10_10
#define NSAppKitVersionNumber10_10 1343
#endif
#if defined(MAC_OS_X_VERSION_MAX_ALLOWED)
#if MAC_OS_X_VERSION_MAX_ALLOWED < 10100
// Built using < 10.10 sdk
LSSharedFileListItemResolve(item, resolutionFlags, ¤tItemURL, NULL);
#else
// Built using >= 10.10 sdk and detected >= 10.10 at runtime
if (floor(NSAppKitVersionNumber) >= NSAppKitVersionNumber10_10)
currentItemURL = LSSharedFileListItemCopyResolvedURL(item, resolutionFlags, NULL);
#if MAC_OS_X_VERSION_MIN_REQUIRED < 10100
else // Built using >= 10.10 sdk with back-compat and detected < 10.10 at runtime
LSSharedFileListItemResolve(item, resolutionFlags, ¤tItemURL, NULL);
#endif
#endif
#endif |
|
Uh. Thanks cfields! You totally right. |
|
If you need all that crazyness just to work around a deprecation warning... |
|
@cfields Uff, yes. |
|
But it is not fun, I agree ;-) |
|
I'm looking forward to when we can drop 10.6 compat, and just set 10.7 as the minimum osx. |
|
Not the right wumpus! |
|
@wumpus Greg Lindahl / could you please stop spamming. Thanks. |
|
Huh, spamming? Mr wumpus was just replying because @paveljanik highlighted the wrong person. He's the one that should stand in the corner, if anyone :) |
|
@laanwj Yes. Sorry. IRC/Github mix. |
3a7b475 to
121f0d9
Compare
|
OK, @cfields's version used. |
|
Travis OK. |
|
OS X 10.9 OK too. |
|
@paveljanik Following up from the recent SDK changes, cfields has suggested a new patch. |
|
After looking at that again, we'd still get the deprecation warning with the above code. One more try: |
121f0d9 to
9100f97
Compare
|
Updated. |
…SSharedFileListItemCopyResolvedURL() instead
9100f97 to
6bbca99
Compare
|
fixed the wrong assignment, waiting for Travis. |
|
Builds without warning now on Travis and native OS X 10.10. |
6bbca99 LSSharedFileListItemResolve() was deprecated in Mac OS X 10.10, use LSSharedFileListItemCopyResolvedURL() instead (Cory Fields)
LABEL: Mac
The current master emits this warning on OS X Yosemite Version 10.10:
Change the code to use the new semantics on the 10.10 and higher systems.