Skip to content

Commit 24cdbad

Browse files
committed
SDK: guard BSD specific paths against windows
Treat windows like Linux and android and remove the BSD interfaces on these targets. This allows us to mostly build the SDK overlay for Windows.
1 parent f6376cb commit 24cdbad

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/swift/Source.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ extension DispatchSource {
113113
}
114114
#endif
115115

116-
#if !os(Linux) && !os(Android)
116+
#if !os(Linux) && !os(Android) && !os(Windows)
117117
public struct ProcessEvent : OptionSet, RawRepresentable {
118118
public let rawValue: UInt
119119
public init(rawValue: UInt) { self.rawValue = rawValue }
@@ -171,7 +171,7 @@ extension DispatchSource {
171171
}
172172
#endif
173173

174-
#if !os(Linux) && !os(Android)
174+
#if !os(Linux) && !os(Android) && !os(Windows)
175175
public class func makeProcessSource(identifier: pid_t, eventMask: ProcessEvent, queue: DispatchQueue? = nil) -> DispatchSourceProcess {
176176
let source = dispatch_source_create(_swift_dispatch_source_type_PROC(), UInt(identifier), eventMask.rawValue, queue?.__wrapped)
177177
return DispatchSource(source: source) as DispatchSourceProcess
@@ -208,7 +208,7 @@ extension DispatchSource {
208208
return DispatchSource(source: source) as DispatchSourceUserDataReplace
209209
}
210210

211-
#if !os(Linux) && !os(Android)
211+
#if !os(Linux) && !os(Android) && !os(Windows)
212212
public class func makeFileSystemObjectSource(fileDescriptor: Int32, eventMask: FileSystemEvent, queue: DispatchQueue? = nil) -> DispatchSourceFileSystemObject {
213213
let source = dispatch_source_create(_swift_dispatch_source_type_VNODE(), UInt(fileDescriptor), eventMask.rawValue, queue?.__wrapped)
214214
return DispatchSource(source: source) as DispatchSourceFileSystemObject
@@ -261,7 +261,7 @@ extension DispatchSourceMemoryPressure {
261261
}
262262
#endif
263263

264-
#if !os(Linux) && !os(Android)
264+
#if !os(Linux) && !os(Android) && !os(Windows)
265265
extension DispatchSourceProcess {
266266
public var handle: pid_t {
267267
return pid_t(dispatch_source_get_handle(self as! DispatchSource))
@@ -617,7 +617,7 @@ extension DispatchSourceTimer {
617617
}
618618
}
619619

620-
#if !os(Linux) && !os(Android)
620+
#if !os(Linux) && !os(Android) && !os(Windows)
621621
extension DispatchSourceFileSystemObject {
622622
public var handle: Int32 {
623623
return Int32(dispatch_source_get_handle((self as! DispatchSource).__wrapped))

src/swift/Wrapper.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ extension DispatchSource : DispatchSourceMachSend,
181181
}
182182
#endif
183183

184-
#if !os(Linux) && !os(Android)
184+
#if !os(Linux) && !os(Android) && !os(Windows)
185185
extension DispatchSource : DispatchSourceProcess,
186186
DispatchSourceFileSystemObject {
187187
}
@@ -272,7 +272,7 @@ public protocol DispatchSourceMemoryPressure : DispatchSourceProtocol {
272272
}
273273
#endif
274274

275-
#if !os(Linux) && !os(Android)
275+
#if !os(Linux) && !os(Android) && !os(Windows)
276276
public protocol DispatchSourceProcess : DispatchSourceProtocol {
277277
var handle: pid_t { get }
278278

@@ -302,7 +302,7 @@ public protocol DispatchSourceTimer : DispatchSourceProtocol {
302302
func scheduleRepeating(wallDeadline: DispatchWallTime, interval: Double, leeway: DispatchTimeInterval)
303303
}
304304

305-
#if !os(Linux) && !os(Android)
305+
#if !os(Linux) && !os(Android) && !os(Windows)
306306
public protocol DispatchSourceFileSystemObject : DispatchSourceProtocol {
307307
var handle: Int32 { get }
308308

0 commit comments

Comments
 (0)