Skip to content
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

Merged
merged 2 commits into from
Aug 2, 2023
Merged

Fix building Mixxx with SDK 11 #11766

merged 2 commits into from
Aug 2, 2023

Conversation

daschuer
Copy link
Member

Our minimum is SDK 10.12

This allows to compile Mixxx with SDK 11
Comment on lines +99 to +103
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 120000)
if (@available(macOS 12.0, *)) {
isPrimary = [playlist isPrimary];
} else {
} else
#endif
Copy link
Member

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

Copy link
Member Author

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

Copy link
Member

@Swiftb0y Swiftb0y Aug 2, 2023

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?

Copy link
Member Author

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.

Copy link
Member

@Swiftb0y Swiftb0y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Swiftb0y Swiftb0y merged commit 2e3d72f into mixxxdj:2.4 Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants