Skip to content

Commit d3610e9

Browse files
authored
[Windows] Fix Int32(bitPattern:) call failure (#708)
* Fix Int32(bitPattern:) call failure * Avoid trap for identifiers within Int32.max ..< UInt32.max
1 parent 9a44043 commit d3610e9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/FoundationEssentials/ProcessInfo/ProcessInfo.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ final class _ProcessInfo: Sendable {
138138

139139
var processIdentifier: Int32 {
140140
#if os(Windows)
141-
return Int32(bitPattern: GetProcessId(GetCurrentProcess()))
141+
return Int32(bitPattern: UInt32(GetProcessId(GetCurrentProcess())))
142142
#else
143143
return Int32(getpid())
144144
#endif

0 commit comments

Comments
 (0)