File tree Expand file tree Collapse file tree 18 files changed +348
-19
lines changed Expand file tree Collapse file tree 18 files changed +348
-19
lines changed Original file line number Diff line number Diff line change 20
20
21
21
#include < type_traits>
22
22
23
- #if (defined(__APPLE__) || defined(__linux__) || defined(__CYGWIN__) || defined(__FreeBSD__) || defined(__HAIKU__))
23
+ #if (defined(__APPLE__) || defined(__linux__) || defined(__CYGWIN__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined( __HAIKU__))
24
24
#include " swift/Runtime/MutexPThread.h"
25
25
#elif defined(_WIN32)
26
26
#include " swift/Runtime/MutexWin32.h"
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ import SwiftPrivateLibcExtras
41
41
import SwiftPrivateThreadExtras
42
42
#if os(macOS) || os(iOS)
43
43
import Darwin
44
- #elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku) || os(WASI)
44
+ #elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os( PS4) || os(Android) || os(Cygwin) || os(Haiku) || os(WASI)
45
45
import Glibc
46
46
#elseif os(Windows)
47
47
import MSVCRT
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ import SwiftPrivate
14
14
import SwiftPrivateLibcExtras
15
15
#if os(macOS) || os(iOS)
16
16
import Darwin
17
- #elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku) || os(WASI)
17
+ #elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os( PS4) || os(Android) || os(Cygwin) || os(Haiku) || os(WASI)
18
18
import Glibc
19
19
#elseif os(Windows)
20
20
import MSVCRT
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ import SwiftPrivateLibcExtras
18
18
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
19
19
import Foundation
20
20
import Darwin
21
- #elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku) || os(WASI)
21
+ #elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os( PS4) || os(Android) || os(Cygwin) || os(Haiku) || os(WASI)
22
22
import Glibc
23
23
#elseif os(Windows)
24
24
import MSVCRT
@@ -1744,6 +1744,7 @@ public enum OSVersion : CustomStringConvertible {
1744
1744
case watchOSSimulator
1745
1745
case linux
1746
1746
case freeBSD
1747
+ case openBSD
1747
1748
case android
1748
1749
case ps4
1749
1750
case windowsCygnus
@@ -1771,6 +1772,8 @@ public enum OSVersion : CustomStringConvertible {
1771
1772
return " Linux "
1772
1773
case . freeBSD:
1773
1774
return " FreeBSD "
1775
+ case . openBSD:
1776
+ return " OpenBSD "
1774
1777
case . ps4:
1775
1778
return " PS4 "
1776
1779
case . android:
@@ -1817,6 +1820,8 @@ func _getOSVersion() -> OSVersion {
1817
1820
return . linux
1818
1821
#elseif os(FreeBSD)
1819
1822
return . freeBSD
1823
+ #elseif os(OpenBSD)
1824
+ return . openBSD
1820
1825
#elseif os(PS4)
1821
1826
return . ps4
1822
1827
#elseif os(Android)
Original file line number Diff line number Diff line change 12
12
13
13
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
14
14
import Darwin
15
- #elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku) || os(WASI)
15
+ #elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os( PS4) || os(Android) || os(Cygwin) || os(Haiku) || os(WASI)
16
16
import Glibc
17
17
#elseif os(Windows)
18
18
import MSVCRT
21
21
#error("Unsupported platform")
22
22
#endif
23
23
24
- #if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
24
+ #if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(OpenBSD)
25
25
let RTLD_DEFAULT = UnsafeMutableRawPointer ( bitPattern: - 2 )
26
26
#elseif os(Linux)
27
27
let RTLD_DEFAULT = UnsafeMutableRawPointer ( bitPattern: 0 )
Original file line number Diff line number Diff line change 13
13
import SwiftPrivate
14
14
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
15
15
import Darwin
16
- #elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku) || os(WASI)
16
+ #elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os( PS4) || os(Android) || os(Cygwin) || os(Haiku) || os(WASI)
17
17
import Glibc
18
18
#elseif os(Windows)
19
19
import MSVCRT
Original file line number Diff line number Diff line change 13
13
import SwiftPrivate
14
14
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
15
15
import Darwin
16
- #elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku) || os(WASI)
16
+ #elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os( PS4) || os(Android) || os(Cygwin) || os(Haiku) || os(WASI)
17
17
import Glibc
18
18
#elseif os(Windows)
19
19
import MSVCRT
Original file line number Diff line number Diff line change 17
17
18
18
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
19
19
import Darwin
20
- #elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
20
+ #elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os( PS4) || os(Android) || os(Cygwin) || os(Haiku)
21
21
import Glibc
22
22
#elseif os(Windows)
23
23
import MSVCRT
Original file line number Diff line number Diff line change 12
12
13
13
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
14
14
import Darwin
15
- #elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
15
+ #elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os( PS4) || os(Android) || os(Cygwin) || os(Haiku)
16
16
import Glibc
17
17
#elseif os(Windows)
18
18
import MSVCRT
@@ -33,7 +33,7 @@ public struct _stdlib_thread_barrier_t {
33
33
#if os(Windows)
34
34
var mutex : UnsafeMutablePointer < SRWLOCK > ?
35
35
var cond : UnsafeMutablePointer < CONDITION_VARIABLE > ?
36
- #elseif os(Cygwin) || os(FreeBSD)
36
+ #elseif os(Cygwin) || os(FreeBSD) || os(OpenBSD)
37
37
var mutex : UnsafeMutablePointer < pthread_mutex_t ? > ?
38
38
var cond : UnsafeMutablePointer < pthread_cond_t ? > ?
39
39
#else
Original file line number Diff line number Diff line change @@ -80,6 +80,8 @@ foreach(sdk ${SWIFT_SDKS})
80
80
81
81
if (${sdk} STREQUAL ANDROID )
82
82
set (glibc_modulemap_source "bionic.modulemap.gyb" )
83
+ elseif (${sdk} STREQUAL OPENBSD )
84
+ set (glibc_modulemap_source "libc-openbsd.modulemap.gyb" )
83
85
else ()
84
86
set (glibc_modulemap_source "glibc.modulemap.gyb" )
85
87
endif ()
You can’t perform that action at this time.
0 commit comments