Skip to content

Commit dd893fc

Browse files
authored
Foundation: explicitly cast value on Windows for 32-bits
The `ERROR_CANCELLED` constant is imported as an `Int`, but `POSIXError` expects an `Int32`. Explicitly cast the value to make the 32-bit builds clean.
1 parent 574b0ec commit dd893fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/Foundation/NSError.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1316,7 +1316,7 @@ extension POSIXError {
13161316
/// Operation canceled.
13171317
public static var ECANCELED: POSIXError.Code {
13181318
#if os(Windows)
1319-
return POSIXError.Code(rawValue: ERROR_CANCELLED)!
1319+
return POSIXError.Code(rawValue: Int32(ERROR_CANCELLED))!
13201320
#else
13211321
return .ECANCELED
13221322
#endif

0 commit comments

Comments
 (0)