Skip to content

Commit e48ae37

Browse files
committed
Add Swift wrapper functions for C API to avoid clients needing to depend on the importer
1 parent f9b4010 commit e48ae37

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

Sources/TSCBasic/Process/Process.swift

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,10 +1316,10 @@ extension Process: Hashable {
13161316
// MARK: - Private helpers
13171317

13181318
#if !os(Windows)
1319-
#if canImport(Darwin)
1320-
private typealias swiftpm_posix_spawn_file_actions_t = posix_spawn_file_actions_t?
1319+
#if canImport(Darwin) || os(FreeBSD) || os(OpenBSD)
1320+
public typealias swiftpm_posix_spawn_file_actions_t = posix_spawn_file_actions_t?
13211321
#else
1322-
private typealias swiftpm_posix_spawn_file_actions_t = posix_spawn_file_actions_t
1322+
public typealias swiftpm_posix_spawn_file_actions_t = posix_spawn_file_actions_t
13231323
#endif
13241324

13251325
private func WIFEXITED(_ status: Int32) -> Bool {
@@ -1455,3 +1455,17 @@ extension Process {
14551455
stdoutStream.flush()
14561456
}
14571457
}
1458+
1459+
#if !os(Windows)
1460+
@available(iOS, unavailable)
1461+
@available(tvOS, unavailable)
1462+
@available(watchOS, unavailable)
1463+
@available(visionOS, unavailable)
1464+
public func TSC_posix_spawn_file_actions_addchdir_np(_ file_actions: UnsafeMutablePointer<swiftpm_posix_spawn_file_actions_t>?, _ path: UnsafePointer<CChar>?) -> CInt {
1465+
TSCclibc.SPM_posix_spawn_file_actions_addchdir_np(file_actions, path)
1466+
}
1467+
1468+
public func TSC_posix_spawn_file_actions_addchdir_np_supported() -> Bool {
1469+
TSCclibc.SPM_posix_spawn_file_actions_addchdir_np_supported()
1470+
}
1471+
#endif

0 commit comments

Comments
 (0)