-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fix building Mixxx with SDK 11 #11766
Conversation
This allows to compile Mixxx with SDK 11
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 120000) | ||
if (@available(macOS 12.0, *)) { | ||
isPrimary = [playlist isPrimary]; | ||
} else { | ||
} else | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whats the error here? I figured if @available
is asking for a version lower than the current SDK it would just return false
. the official docs don't specify that unfortunately. https://developer.apple.com/documentation/swift/marking-api-availability-in-objective-c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error was "isPrimary() is not a member of ..."
This is because you need the maximum SDK at build time to have all used definitions in the headers.
Your assumption is correct for the runtime check of @available
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah that makes sense. Thanks for the explanation. Isn't the @available
check redundant in that case then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need both in case of a new SDK build executed on an old macOS. Than the #if
is true and @available
false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Our minimum is SDK 10.12