@@ -465,7 +465,7 @@ public final class Process {
465465
466466 try _process? . run ( )
467467 return stdinPipe. fileHandleForWriting
468- #else
468+ #elseif (!canImport(Darwin) || os(macOS))
469469 // Initialize the spawn attributes.
470470 #if canImport(Darwin) || os(Android) || os(OpenBSD)
471471 var attributes : posix_spawnattr_t ? = nil
@@ -481,7 +481,7 @@ public final class Process {
481481 posix_spawnattr_setsigmask ( & attributes, & noSignals)
482482
483483 // Reset all signals to default behavior.
484- #if os(macOS )
484+ #if canImport(Darwin )
485485 var mostSignals = sigset_t ( )
486486 sigfillset ( & mostSignals)
487487 sigdelset ( & mostSignals, SIGKILL)
@@ -521,7 +521,7 @@ public final class Process {
521521 defer { posix_spawn_file_actions_destroy ( & fileActions) }
522522
523523 if let workingDirectory = workingDirectory? . pathString {
524- #if os(macOS )
524+ #if canImport(Darwin )
525525 // The only way to set a workingDirectory is using an availability-gated initializer, so we don't need
526526 // to handle the case where the posix_spawn_file_actions_addchdir_np method is unavailable. This check only
527527 // exists here to make the compiler happy.
@@ -669,6 +669,8 @@ public final class Process {
669669 }
670670
671671 return stdinStream
672+ #else
673+ preconditionFailure ( " Process spawning is not available " )
672674 #endif // POSIX implementation
673675 }
674676
@@ -849,7 +851,7 @@ extension Process: Hashable {
849851// MARK: - Private helpers
850852
851853#if !os(Windows)
852- #if os(macOS )
854+ #if canImport(Darwin )
853855private typealias swiftpm_posix_spawn_file_actions_t = posix_spawn_file_actions_t ?
854856#else
855857private typealias swiftpm_posix_spawn_file_actions_t = posix_spawn_file_actions_t
0 commit comments