|
12 | 12 |
|
13 | 13 | import CDispatch |
14 | 14 | import _SwiftDispatchOverlayShims |
15 | | -#if os(Windows) |
| 15 | +#if os(Windows) && !os(OpenBSD) |
16 | 16 | import WinSDK |
17 | 17 | #endif |
18 | 18 |
|
@@ -116,7 +116,7 @@ extension DispatchSource { |
116 | 116 | } |
117 | 117 | #endif |
118 | 118 |
|
119 | | -#if !os(Linux) && !os(Android) && !os(Windows) |
| 119 | +#if !os(Linux) && !os(Android) && !os(Windows) && !os(OpenBSD) |
120 | 120 | public struct ProcessEvent : OptionSet, RawRepresentable { |
121 | 121 | public let rawValue: UInt |
122 | 122 | public init(rawValue: UInt) { self.rawValue = rawValue } |
@@ -174,22 +174,22 @@ extension DispatchSource { |
174 | 174 | } |
175 | 175 | #endif |
176 | 176 |
|
177 | | -#if !os(Linux) && !os(Android) && !os(Windows) |
| 177 | +#if !os(Linux) && !os(Android) && !os(Windows) && !os(OpenBSD) |
178 | 178 | public class func makeProcessSource(identifier: pid_t, eventMask: ProcessEvent, queue: DispatchQueue? = nil) -> DispatchSourceProcess { |
179 | 179 | let source = dispatch_source_create(_swift_dispatch_source_type_PROC(), UInt(identifier), eventMask.rawValue, queue?.__wrapped) |
180 | 180 | return DispatchSource(source: source) as DispatchSourceProcess |
181 | 181 | } |
182 | 182 | #endif |
183 | 183 |
|
184 | | -#if os(Windows) |
| 184 | +#if os(Windows) && !os(OpenBSD) |
185 | 185 | public class func makeReadSource(handle: HANDLE, queue: DispatchQueue? = nil) -> DispatchSourceRead { |
186 | 186 | let source = dispatch_source_create(_swift_dispatch_source_type_READ(), UInt(bitPattern: handle), 0, queue?.__wrapped) |
187 | 187 | return DispatchSource(source: source) as DispatchSourceRead |
188 | 188 | } |
189 | 189 | #endif |
190 | 190 |
|
191 | 191 | public class func makeReadSource(fileDescriptor: Int32, queue: DispatchQueue? = nil) -> DispatchSourceRead { |
192 | | -#if os(Windows) |
| 192 | +#if os(Windows) && !os(OpenBSD) |
193 | 193 | let handle: UInt = UInt(_get_osfhandle(fileDescriptor)) |
194 | 194 | if handle == UInt(bitPattern: INVALID_HANDLE_VALUE) { fatalError("unable to get underlying handle from file descriptor") } |
195 | 195 | #else |
@@ -224,22 +224,22 @@ extension DispatchSource { |
224 | 224 | return DispatchSource(source: source) as DispatchSourceUserDataReplace |
225 | 225 | } |
226 | 226 |
|
227 | | -#if !os(Linux) && !os(Android) && !os(Windows) |
| 227 | +#if !os(Linux) && !os(Android) && !os(Windows) && !os(OpenBSD) |
228 | 228 | public class func makeFileSystemObjectSource(fileDescriptor: Int32, eventMask: FileSystemEvent, queue: DispatchQueue? = nil) -> DispatchSourceFileSystemObject { |
229 | 229 | let source = dispatch_source_create(_swift_dispatch_source_type_VNODE(), UInt(fileDescriptor), eventMask.rawValue, queue?.__wrapped) |
230 | 230 | return DispatchSource(source: source) as DispatchSourceFileSystemObject |
231 | 231 | } |
232 | 232 | #endif |
233 | 233 |
|
234 | | -#if os(Windows) |
| 234 | +#if os(Windows) && !os(OpenBSD) |
235 | 235 | public class func makeWriteSource(handle: HANDLE, queue: DispatchQueue? = nil) -> DispatchSourceWrite { |
236 | 236 | let source = dispatch_source_create(_swift_dispatch_source_type_WRITE(), UInt(bitPattern: handle), 0, queue?.__wrapped) |
237 | 237 | return DispatchSource(source: source) as DispatchSourceWrite |
238 | 238 | } |
239 | 239 | #endif |
240 | 240 |
|
241 | 241 | public class func makeWriteSource(fileDescriptor: Int32, queue: DispatchQueue? = nil) -> DispatchSourceWrite { |
242 | | -#if os(Windows) |
| 242 | +#if os(Windows) && !os(OpenBSD) |
243 | 243 | let handle: UInt = UInt(_get_osfhandle(fileDescriptor)) |
244 | 244 | if handle == UInt(bitPattern: INVALID_HANDLE_VALUE) { fatalError("unable to get underlying handle from file descriptor") } |
245 | 245 | #else |
@@ -290,7 +290,7 @@ extension DispatchSourceMemoryPressure { |
290 | 290 | } |
291 | 291 | #endif |
292 | 292 |
|
293 | | -#if !os(Linux) && !os(Android) && !os(Windows) |
| 293 | +#if !os(Linux) && !os(Android) && !os(Windows) && !os(OpenBSD) |
294 | 294 | extension DispatchSourceProcess { |
295 | 295 | public var handle: pid_t { |
296 | 296 | return pid_t(dispatch_source_get_handle(self as! DispatchSource)) |
@@ -646,7 +646,7 @@ extension DispatchSourceTimer { |
646 | 646 | } |
647 | 647 | } |
648 | 648 |
|
649 | | -#if !os(Linux) && !os(Android) && !os(Windows) |
| 649 | +#if !os(Linux) && !os(Android) && !os(Windows) && !os(OpenBSD) |
650 | 650 | extension DispatchSourceFileSystemObject { |
651 | 651 | public var handle: Int32 { |
652 | 652 | return Int32(dispatch_source_get_handle((self as! DispatchSource).__wrapped)) |
|
0 commit comments