-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Add #if os(Darwin) shorthand for checking for Darwin platforms #59426
base: main
Are you sure you want to change the base?
Conversation
@hamishknight Looks good ^? Could you ask it to test? |
…test compiler invokation, call OSX on checkPlatformCondition rather than macOS
@hamishknight look all good? |
@swift-ci please test |
@hamishknight looks like we couldn't use types from the stdlib, fixed that, could you ask it to test again? |
Yeah @swift-ci please test |
@AnthonyLatsis did Linux just immediately fail? |
@swift-ci please test Linux |
Probably just Jenkins flakiness |
@hamishknight seems it’s working, could you ask it to build a toolchain? |
@swift-ci please build toolchain |
Works locally :) |
@hamishknight Ready for merge now? |
Darwin
platform
Implementation looks good to me, though I think this will probably require evolution discussion before being merged. |
I’ve opened a discussion post here, one thing I was considering was |
Yeah, note you would also need a way to map the Darwin version numbers to the individual platform version numbers, which I'm not sure we'd want to bake into the compiler. FWIW we use availability macros (e.g |
Thank you for tackling this! |
@CodaFi Could you ask CI to test? |
@swift-ci smoke test |
@CodaFi Works great! Thanks for letting me know of that method, all that's left now is for the proposal to be reviewed & approved, which I just opened yesterday |
mistake^ |
It's been a while so let's re-test this @swift-ci smoke test |
is ci borked |
The trigger I used picked up my words and tried to interpret them as a repository. |
@swift-ci smoke test |
I think we should exclude DriverKit from i.e. instead of |
The pr is dead. Though I agree |
This PR adds support for
Darwin
as a platform that can be used in a#if os
statement, so the following code:You could instead do: