Skip to content

Commit 20dfb83

Browse files
committed
Fix compilation on Linux for Swift 6
1 parent 995fc74 commit 20dfb83

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Sources/ProcessInvocation/ProcessInvocation.swift

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,13 @@ class XcodeToolsProcessExtender : NSObject, SPITaskExtender {
10961096
still let clients use it. */
10971097
private class XcodeToolsProcess : Process {
10981098

1099-
var privateTerminationHandler: ((Process) -> Void)? {
1099+
#if swift(>=6)
1100+
typealias TerminationHandler = (@Sendable (Process) -> Void)
1101+
#else
1102+
typealias TerminationHandler = ((Process) -> Void)
1103+
#endif
1104+
1105+
var privateTerminationHandler: TerminationHandler? {
11001106
didSet {updateTerminationHandler()}
11011107
}
11021108

@@ -1111,12 +1117,12 @@ private class XcodeToolsProcess : Process {
11111117
Conf.logger?.trace("Deinit of an XcodeToolsProcess")
11121118
}
11131119

1114-
override var terminationHandler: ((Process) -> Void)? {
1120+
override var terminationHandler: TerminationHandler? {
11151121
get {super.terminationHandler}
11161122
set {publicTerminationHandler = newValue; updateTerminationHandler()}
11171123
}
11181124

1119-
private var publicTerminationHandler: ((Process) -> Void)?
1125+
private var publicTerminationHandler: TerminationHandler?
11201126

11211127
/**
11221128
Sets super’s terminationHandler to nil if both private and public termination handlers are nil, otherwise set it to call them. */

0 commit comments

Comments
 (0)