-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathswift-system.patch
66 lines (65 loc) · 2.12 KB
/
swift-system.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
diff --git a/swift-system/Sources/System/Internals/CInterop.swift b/swift-system/Sources/System/Internals/CInterop.swift
index 13abc75..2ad551a 100644
--- a/swift-system/Sources/System/Internals/CInterop.swift
+++ b/swift-system/Sources/System/Internals/CInterop.swift
@@ -25,6 +25,9 @@ import Glibc
#elseif canImport(Musl)
@_implementationOnly import CSystem
import Musl
+#elseif canImport(Bionic)
+@_implementationOnly import CSystem
+import Bionic
#else
#error("Unsupported Platform")
#endif
diff --git a/swift-system/Sources/System/Internals/Constants.swift b/swift-system/Sources/System/Internals/Constants.swift
index 53e215f..27039de 100644
--- a/swift-system/Sources/System/Internals/Constants.swift
+++ b/swift-system/Sources/System/Internals/Constants.swift
@@ -18,6 +18,8 @@ import CSystem
import ucrt
#elseif canImport(Glibc)
import Glibc
+#elseif canImport(Android)
+import Android
#elseif canImport(Musl)
import CSystem
import Musl
diff --git a/swift-system/Sources/System/Internals/Exports.swift b/swift-system/Sources/System/Internals/Exports.swift
index 5b08725..899be25 100644
--- a/swift-system/Sources/System/Internals/Exports.swift
+++ b/swift-system/Sources/System/Internals/Exports.swift
@@ -23,6 +23,9 @@ import Glibc
#elseif canImport(Musl)
@_implementationOnly import CSystem
import Musl
+#elseif canImport(Android)
+@_implementationOnly import CSystem
+import Android
#else
#error("Unsupported Platform")
#endif
@@ -58,6 +61,11 @@ internal var system_errno: CInt {
get { Musl.errno }
set { Musl.errno = newValue }
}
+#elseif canImport(Android)
+internal var system_errno: CInt {
+ get { Android.errno }
+ set { Android.errno = newValue }
+}
#endif
// MARK: C stdlib decls
diff --git a/swift-system/Sources/System/Internals/Syscalls.swift b/swift-system/Sources/System/Internals/Syscalls.swift
index 555f63b..f0db35f 100644
--- a/swift-system/Sources/System/Internals/Syscalls.swift
+++ b/swift-system/Sources/System/Internals/Syscalls.swift
@@ -15,6 +15,8 @@ import Glibc
import Musl
#elseif os(Windows)
import ucrt
+#elseif canImport(Android)
+import Android
#else
#error("Unsupported Platform")
#endif