Skip to content

Commit 2b3ce5b

Browse files
committed
Fix os(WASI) build issue
1 parent d444641 commit 2b3ce5b

File tree

23 files changed

+26
-22
lines changed

23 files changed

+26
-22
lines changed

Sources/OpenSwiftUI/AppStructure/AppOrganization/TODO/OpenSwiftUIApplication.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,13 @@ private func KitRendererCommon() -> Never {
6161
#elseif os(macOS)
6262
// FIXME
6363
let code = NSApplicationMain(argc, argv)
64-
#elseif os(Linux)
64+
#else
6565
let code: Int32 = 1
6666
#endif
6767
exit(code)
6868
}
6969

70+
#if canImport(Darwin)
7071
func currentAppName() -> String {
7172
if let name = Bundle.main.localizedValue(for: "CFBundleDisplayName") {
7273
return name
@@ -90,3 +91,4 @@ extension Bundle {
9091
}
9192
}
9293
}
94+
#endif

Sources/OpenSwiftUI/Internal/Graph/TODO/_GraphInputs.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public struct _GraphInputs {
99
var changedDebugProperties: _ViewDebug.Properties
1010
var options: _GraphInputs.Options
1111
// FIXME: Compile crash on Linux
12-
#if !os(Linux)
12+
#if canImport(Darwin)
1313
var mergedInputs: Set<OGAttribute>
1414
#endif
1515
}

Sources/OpenSwiftUI/Internal/Other/EnvironmentHelper.swift

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
import Darwin
33
#elseif canImport(Glibc)
44
import Glibc
5+
#elseif os(WASI)
6+
import WASILibc
57
#else
68
#error("Unsupported Platform")
79
#endif

Sources/OpenSwiftUI/Layout/LayoutAdjustments/Alignment/AlignmentID.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#if canImport(Darwin)
1010
import CoreGraphics
11-
#elseif os(Linux)
11+
#else
1212
import Foundation
1313
#endif
1414

Sources/OpenSwiftUI/Layout/LayoutAdjustments/Alignment/HorizontalAlignment.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#if canImport(Darwin)
1111
import CoreGraphics
12-
#elseif os(Linux)
12+
#else
1313
import Foundation
1414
#endif
1515

Sources/OpenSwiftUI/Layout/LayoutAdjustments/Alignment/VerticalAlignment.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#if canImport(Darwin)
1111
import CoreGraphics
12-
#elseif os(Linux)
12+
#else
1313
import Foundation
1414
#endif
1515

Sources/OpenSwiftUI/Layout/LayoutAdjustments/Alignment/ViewDimensions.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#if canImport(Darwin)
1010
import CoreGraphics
11-
#elseif os(Linux)
11+
#else
1212
import Foundation
1313
#endif
1414

Sources/OpenSwiftUI/Layout/LayoutAdjustments/Edge/EdgeInsets.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#if canImport(Darwin)
1010
import CoreGraphics
11-
#elseif os(Linux)
11+
#else
1212
import Foundation
1313
#endif
1414

Sources/OpenSwiftUI/Layout/LayoutFundamentals/Stack/HStack.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#if canImport(Darwin)
22
import CoreGraphics
3-
#elseif os(Linux)
3+
#else
44
import Foundation
55
#endif
66

Sources/OpenSwiftUI/Layout/LayoutFundamentals/Stack/_HStackLayout.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#if canImport(Darwin)
22
import CoreGraphics
3-
#elseif os(Linux)
3+
#else
44
import Foundation
55
#endif
66

Sources/OpenSwiftUI/Layout/LayoutFundamentals/internal/LayoutComputer.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#if canImport(Darwin)
1010
import CoreGraphics
11-
#elseif os(Linux)
11+
#else
1212
import Foundation
1313
#endif
1414

Sources/OpenSwiftUI/Layout/LayoutFundamentals/internal/Spacing.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#if canImport(Darwin)
1111
import CoreGraphics
12-
#elseif os(Linux)
12+
#else
1313
import Foundation
1414
#endif
1515

Sources/OpenSwiftUI/Layout/LayoutFundamentals/internal/_ProposedSize.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#if canImport(Darwin)
1010
import CoreGraphics
11-
#elseif os(Linux)
11+
#else
1212
import Foundation
1313
#endif
1414

Sources/OpenSwiftUI/Test/_BenchmarkHost.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#if canImport(Darwin)
1111
import CoreGraphics
12-
#elseif os(Linux)
12+
#else
1313
import Foundation
1414
#endif
1515

Sources/OpenSwiftUI/UIElements/Font/TODO/Font.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#if canImport(Darwin)
22
import CoreGraphics
3-
#elseif os(Linux)
3+
#else
44
import Foundation
55
#endif
66

Sources/OpenSwiftUI/UIElements/Text/TODO/Text.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#if canImport(Darwin)
1010
import CoreGraphics
11-
#elseif os(Linux)
11+
#else
1212
import Foundation
1313
#endif
1414

Sources/OpenSwiftUI/Views/Animations/TODO/Animatable.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ extension Animatable where AnimatableData == EmptyAnimatableData {
4444

4545
#if canImport(Darwin)
4646
import CoreGraphics
47-
#elseif os(Linux)
47+
#else
4848
import Foundation
4949
#endif
5050

Sources/OpenSwiftUI/Views/Animations/VectorArithmetic.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ extension Double: VectorArithmetic {
5959

6060
#if canImport(Darwin)
6161
import CoreGraphics
62-
#elseif os(Linux)
62+
#else
6363
import Foundation
6464
#endif
6565

Sources/OpenSwiftUI/Views/View/ViewTransform.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#if canImport(Darwin)
44
import CoreGraphics
5-
#elseif os(Linux)
5+
#else
66
import Foundation
77
#endif
88

Sources/OpenSwiftUI/Views/View/_IdentifiedViewProxy.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#if canImport(Darwin)
22
import CoreGraphics
3-
#elseif os(Linux)
3+
#else
44
import Foundation
55
#endif
66

Sources/OpenSwiftUIShims/include/LockedPointer.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#define OPENSWIFTUI_LOCK_INIT OS_UNFAIR_LOCK_INIT
1717
#define OPENSWIFTUI_LOCK_LOCK(lock) os_unfair_lock_lock(lock)
1818
#define OPENSWIFTUI_LOCK_UNLOCK(lock) os_unfair_lock_unlock(lock)
19-
#elif OPENSWIFTUI_TARGET_OS_LINUX
19+
#else
2020
#define OPENSWIFTUI_LOCK_T int32_t
2121
#include <stdint.h>
2222
#include <unistd.h>

Tests/OpenSwiftUITests/Layout/LayoutAdjustments/Alignment/AlignmentIDTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import Testing
1010
#if canImport(Darwin)
1111
import CoreGraphics
12-
#elseif os(Linux)
12+
#else
1313
import Foundation
1414
#endif
1515

Tests/OpenSwiftUITests/_ViewDebugTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import Testing
1010
#if canImport(Darwin)
1111
import CoreGraphics
12-
#elseif os(Linux)
12+
#else
1313
import Foundation
1414
#endif
1515

0 commit comments

Comments
 (0)