Skip to content

Commit 847c107

Browse files
committed
Accommodate Android, where posix_spawnattr_t and posix_spawn_file_actions_t are opaque pointers
This is needed to compile on the Android platform.
1 parent c26cd00 commit 847c107

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Sources/TSCBasic/Process/Process.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,9 @@ public final class Process {
626626
return stdinPipe.fileHandleForWriting
627627
#elseif (!canImport(Darwin) || os(macOS))
628628
// Initialize the spawn attributes.
629-
#if canImport(Darwin) || os(Android) || os(OpenBSD) || os(FreeBSD)
629+
#if os(Android)
630+
var attributes: posix_spawnattr_t! = nil
631+
#elseif canImport(Darwin) || os(OpenBSD) || os(FreeBSD)
630632
var attributes: posix_spawnattr_t? = nil
631633
#else
632634
var attributes = posix_spawnattr_t()
@@ -671,7 +673,9 @@ public final class Process {
671673
posix_spawnattr_setflags(&attributes, Int16(flags))
672674

673675
// Setup the file actions.
674-
#if canImport(Darwin) || os(Android) || os(OpenBSD) || os(FreeBSD)
676+
#if os(Android)
677+
var fileActions: posix_spawn_file_actions_t! = nil
678+
#elseif canImport(Darwin) || os(OpenBSD) || os(FreeBSD)
675679
var fileActions: posix_spawn_file_actions_t? = nil
676680
#else
677681
var fileActions = posix_spawn_file_actions_t()

0 commit comments

Comments
 (0)