Skip to content

Conversation

@j-f1
Copy link
Contributor

@j-f1 j-f1 commented Aug 19, 2024

This helps people avoid silent mistakes when migrating from Objective-C:

#if TARGET_OS_IOS
//  ^ warning: 'TARGET_OS_*' preprocessor macros are not available in Swift; use 'os(iOS)' instead
//  ^ fix-it: replace with 'os(iOS)'
print("I will never be executed, even on iOS!")
#endif

@j-f1 j-f1 requested a review from DougGregor August 19, 2024 16:47
@j-f1 j-f1 requested review from ahoppen and bnbarham as code owners August 19, 2024 16:47
@j-f1
Copy link
Contributor Author

j-f1 commented Aug 19, 2024

@swift-ci please test

Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

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

Looks good

@ahoppen ahoppen enabled auto-merge August 19, 2024 22:54
@ahoppen
Copy link
Member

ahoppen commented Aug 20, 2024

Could you run swift-format on the changes? https://github.com/swiftlang/swift-syntax/blob/main/CONTRIBUTING.md#formatting

@j-f1
Copy link
Contributor Author

j-f1 commented Aug 20, 2024

@swift-ci please test

@ahoppen
Copy link
Member

ahoppen commented Aug 20, 2024

@swift-ci Please test Windows

@ahoppen ahoppen merged commit 5de21b3 into main Aug 20, 2024
@ahoppen ahoppen deleted the jed/target-os branch August 20, 2024 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants