File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed
Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 11#if canImport(PackagePlugin)
2+ #if os(Windows)
3+ import WinSDK
4+ #endif
25import PackagePlugin
36@preconcurrency import Foundation
47
@@ -180,7 +183,11 @@ extension Foundation.Process {
180183 let signalSource = DispatchSource . makeSignalSource ( signal: signalNo)
181184 signalSource. setEventHandler { [ self ] in
182185 signalSource. cancel ( )
186+ #if os(Windows)
187+ _ = TerminateProcess ( processHandle, 0 )
188+ #else
183189 kill ( processIdentifier, signalNo)
190+ #endif
184191 }
185192 signalSource. resume ( )
186193 return signalSource
Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ import class Dispatch.DispatchSource
1313import SwiftParser
1414import SwiftSyntax
1515
16+ #if os(Windows)
17+ import WinSDK
18+ #endif
1619#if canImport(BridgeJSCore)
1720import BridgeJSCore
1821#endif
@@ -141,7 +144,11 @@ extension Foundation.Process {
141144 let signalSource = DispatchSource . makeSignalSource ( signal: signalNo)
142145 signalSource. setEventHandler { [ self ] in
143146 signalSource. cancel ( )
147+ #if os(Windows)
148+ _ = TerminateProcess ( processHandle, 0 )
149+ #else
144150 kill ( processIdentifier, signalNo)
151+ #endif
145152 }
146153 signalSource. resume ( )
147154 return signalSource
Original file line number Diff line number Diff line change 11import Foundation
22
3+ #if os(Windows)
4+ import WinSDK
5+ #endif
36struct PackageToJS {
47 struct PackageOptions {
58 enum Platform : String , CaseIterable {
@@ -785,7 +788,11 @@ extension Foundation.Process {
785788 let signalSource = DispatchSource . makeSignalSource ( signal: signalNo)
786789 signalSource. setEventHandler { [ self ] in
787790 signalSource. cancel ( )
791+ #if os(Windows)
792+ _ = TerminateProcess ( processHandle, 0 )
793+ #else
788794 kill ( processIdentifier, signalNo)
795+ #endif
789796 }
790797 signalSource. resume ( )
791798 return signalSource
You can’t perform that action at this time.
0 commit comments