Skip to content

Commit 9f5f980

Browse files
authored
Merge pull request #2222 from compnerd/xdg-is-not-verify-cross-compatible
TestFoundation: make xdgTestHelper build on Windows
2 parents a0eee94 + 6bdae30 commit 9f5f980

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

TestFoundation/xdgTestHelper/main.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ import SwiftFoundation
1212
#else
1313
import Foundation
1414
#endif
15+
#if os(Windows)
16+
import WinSDK
17+
#endif
1518

1619
enum HelperCheckStatus : Int32 {
1720
case ok = 0
@@ -222,7 +225,11 @@ case "--sleep":
222225

223226
case "--signal-self":
224227
if let signalnum = arguments.next(), let signal = Int32(signalnum) {
228+
#if os(Windows)
229+
TerminateProcess(GetCurrentProcess(), UINT(signal))
230+
#else
225231
kill(ProcessInfo.processInfo.processIdentifier, signal)
232+
#endif
226233
}
227234
exit(1)
228235

0 commit comments

Comments
 (0)