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

[SR-1823] Alias OSX to macOS for conditional compilation blocks os() test #44432

Open
swift-ci opened this issue Jun 19, 2016 · 5 comments
Open
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-1823
Radar rdar://problem/28814205
Original Reporter erica (JIRA User)
Type Bug
Status In Progress
Resolution

Attachment: Download

Environment

Xcode 8 Beta

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: 5e0dd7554fd3dec93fc328131866a4a4

relates to:

  • SR-1887 macOS Sierra name change affects "available"

Issue Description:

Starting in Sierra, Apple's Mac-based OS (OS X) will be renamed "macOS".

The `#if os(OSX)` test should be aliased to `#if os(macOS)` along these lines:

in Lib/Basic/LangOptions.cpp

static const StringRef SupportedConditionalCompilationOSs[] = {
"OSX",
"macOS", // add
"tvOS",
"watchOS",
"iOS",
"Linux",
"FreeBSD",
"Windows",
"Android"
};

// Set the "os" platform condition.
if (Target.isMacOSX()) {
addPlatformConditionValue("os", "OSX");
addPlatformConditionValue("os", "macOS");
}

Proposal: SE-0106

@swift-ci
Copy link
Collaborator Author

swift-ci commented Jul 6, 2016

Comment by erica sadun (JIRA)

Jack Lawrence points out "#if os(OS X) #elseif os(macOS)" should warn on unreachable branch.

@belkadan
Copy link
Contributor

belkadan commented Jul 7, 2016

#3395

@belkadan
Copy link
Contributor

belkadan commented Jul 7, 2016

Oops, that pull request is missing that extra check. I'll leave this bug open until it's implemented. (And once I've merged the above, someone else is free to submit a PR if they get to it first!)

@belkadan
Copy link
Contributor

belkadan commented Jul 8, 2016

Merged the initial PR in b9adb29.

@swift-ci
Copy link
Collaborator Author

Comment by Myke Olson (JIRA)

@swift-cicreate

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

2 participants