1717extension AsyncBufferSequence {
1818 /// A immutable collection of bytes
1919 public struct Buffer : Sendable {
20- #if canImport(Darwin)
20+ #if SUBPROCESS_ASYNCIO_DISPATCH
2121 // We need to keep the backingData alive while Slice is alive
2222 internal let backingData : DispatchData
2323 internal let data : DispatchData . Region
@@ -45,7 +45,7 @@ extension AsyncBufferSequence {
4545 internal static func createFrom( _ data: [ UInt8 ] ) -> [ Buffer ] {
4646 return [ . init( data: data) ]
4747 }
48- #endif // canImport(Darwin)
48+ #endif // SUBPROCESS_ASYNCIO_DISPATCH
4949 }
5050}
5151
@@ -92,7 +92,7 @@ extension AsyncBufferSequence.Buffer {
9292
9393// MARK: - Hashable, Equatable
9494extension AsyncBufferSequence . Buffer : Equatable , Hashable {
95- #if canImport(Darwin)
95+ #if SUBPROCESS_ASYNCIO_DISPATCH
9696 public static func == ( lhs: AsyncBufferSequence . Buffer , rhs: AsyncBufferSequence . Buffer ) -> Bool {
9797 return lhs. data == rhs. data
9898 }
@@ -104,7 +104,7 @@ extension AsyncBufferSequence.Buffer: Equatable, Hashable {
104104 // else Compiler generated conformances
105105}
106106
107- #if canImport(Darwin)
107+ #if SUBPROCESS_ASYNCIO_DISPATCH
108108extension DispatchData . Region {
109109 static func == ( lhs: DispatchData . Region , rhs: DispatchData . Region ) -> Bool {
110110 return lhs. withUnsafeBytes { lhsBytes in
@@ -120,7 +120,7 @@ extension DispatchData.Region {
120120 }
121121 }
122122}
123- #if !SubprocessFoundation
123+ #if !canImport(Darwin) || ! SubprocessFoundation
124124/// `DispatchData.Region` is defined in Foundation, but we can't depend on Foundation when the SubprocessFoundation trait is disabled.
125125extension DispatchData {
126126 typealias Region = _ContiguousBufferView
0 commit comments