17
17
extension AsyncBufferSequence {
18
18
/// A immutable collection of bytes
19
19
public struct Buffer : Sendable {
20
- #if canImport(Darwin)
20
+ #if SUBPROCESS_ASYNCIO_DISPATCH
21
21
// We need to keep the backingData alive while Slice is alive
22
22
internal let backingData : DispatchData
23
23
internal let data : DispatchData . Region
@@ -45,7 +45,7 @@ extension AsyncBufferSequence {
45
45
internal static func createFrom( _ data: [ UInt8 ] ) -> [ Buffer ] {
46
46
return [ . init( data: data) ]
47
47
}
48
- #endif // canImport(Darwin)
48
+ #endif // SUBPROCESS_ASYNCIO_DISPATCH
49
49
}
50
50
}
51
51
@@ -92,7 +92,7 @@ extension AsyncBufferSequence.Buffer {
92
92
93
93
// MARK: - Hashable, Equatable
94
94
extension AsyncBufferSequence . Buffer : Equatable , Hashable {
95
- #if canImport(Darwin)
95
+ #if SUBPROCESS_ASYNCIO_DISPATCH
96
96
public static func == ( lhs: AsyncBufferSequence . Buffer , rhs: AsyncBufferSequence . Buffer ) -> Bool {
97
97
return lhs. data == rhs. data
98
98
}
@@ -104,7 +104,7 @@ extension AsyncBufferSequence.Buffer: Equatable, Hashable {
104
104
// else Compiler generated conformances
105
105
}
106
106
107
- #if canImport(Darwin)
107
+ #if SUBPROCESS_ASYNCIO_DISPATCH
108
108
extension DispatchData . Region {
109
109
static func == ( lhs: DispatchData . Region , rhs: DispatchData . Region ) -> Bool {
110
110
return lhs. withUnsafeBytes { lhsBytes in
@@ -120,7 +120,7 @@ extension DispatchData.Region {
120
120
}
121
121
}
122
122
}
123
- #if !SubprocessFoundation
123
+ #if !canImport(Darwin) || ! SubprocessFoundation
124
124
/// `DispatchData.Region` is defined in Foundation, but we can't depend on Foundation when the SubprocessFoundation trait is disabled.
125
125
extension DispatchData {
126
126
typealias Region = _ContiguousBufferView
0 commit comments