Skip to content

Commit 9cc9a94

Browse files
authored
Merge pull request #20469 from tinysun212/pr-os-macro-cygwin-2
[LangOptions] os(Cygwin) is not true on Cygwin
2 parents 7df4076 + 859f144 commit 9cc9a94

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/Basic/LangOptions.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,10 @@ std::pair<bool, bool> LangOptions::setTarget(llvm::Triple triple) {
184184
addPlatformConditionValue(PlatformConditionKind::OS, "Linux");
185185
else if (Target.isOSFreeBSD())
186186
addPlatformConditionValue(PlatformConditionKind::OS, "FreeBSD");
187-
else if (Target.isOSWindows())
188-
addPlatformConditionValue(PlatformConditionKind::OS, "Windows");
189187
else if (Target.isWindowsCygwinEnvironment())
190188
addPlatformConditionValue(PlatformConditionKind::OS, "Cygwin");
189+
else if (Target.isOSWindows())
190+
addPlatformConditionValue(PlatformConditionKind::OS, "Windows");
191191
else if (Target.isPS4())
192192
addPlatformConditionValue(PlatformConditionKind::OS, "PS4");
193193
else if (Target.isOSHaiku())
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
// RUN: %swift -parse %s -verify -D FOO -D BAR -target x86_64-unknown-windows-cygnus -disable-objc-interop -D FOO -parse-stdlib
1+
// RUN: %swift -typecheck %s -verify -D FOO -D BAR -target x86_64-unknown-windows-cygnus -disable-objc-interop -D FOO -parse-stdlib
22
// RUN: %swift-ide-test -test-input-complete -source-filename=%s -target x86_64-unknown-windows-cygnus
3-
#if arch(x86_64) && os(Cygwin) && _runtime(_Native)
3+
4+
#if arch(x86_64) && os(Cygwin) && _runtime(_Native) && _endian(little)
45
class C {}
56
var x = C()
67
#endif
78
var y = x
8-

0 commit comments

Comments
 (0)