Skip to content

Commit a84ebbc

Browse files
authored
Annotate Cancellator APIs that involve Foundation.Process to exclude platforms that don't have it (#4243)
1 parent 4e30248 commit a84ebbc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Sources/Basics/Cancellator.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,11 @@ public class Cancellator: Cancellable {
5454
self.register(name: "\(process.arguments.joined(separator: " "))", handler: process.terminate)
5555
}
5656

57+
#if !os(iOS) && !os(watchOS) && !os(tvOS)
5758
public func register(_ process: Foundation.Process) -> RegistrationKey? {
5859
self.register(name: "\(process.description)", handler: process.terminate(timeout:))
5960
}
61+
#endif
6062

6163
public func deregister(_ key: RegistrationKey) {
6264
self.registry[key] = nil
@@ -140,6 +142,7 @@ extension TSCBasic.Process {
140142
}
141143
}
142144

145+
#if !os(iOS) && !os(watchOS) && !os(tvOS)
143146
extension Foundation.Process {
144147
fileprivate func terminate(timeout: DispatchTime) {
145148
// send graceful shutdown signal (SIGINT)
@@ -160,3 +163,4 @@ extension Foundation.Process {
160163
forceKillThread.join()
161164
}
162165
}
166+
#endif

0 commit comments

Comments
 (0)