Skip to content

Commit

Permalink
Foundation: explicitly cast value on Windows for 32-bits
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
compnerd authored Jul 15, 2022
1 parent 574b0ec commit dd893fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/Foundation/NSError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1316,7 +1316,7 @@ extension POSIXError {
/// Operation canceled.
public static var ECANCELED: POSIXError.Code {
#if os(Windows)
return POSIXError.Code(rawValue: ERROR_CANCELLED)!
return POSIXError.Code(rawValue: Int32(ERROR_CANCELLED))!
#else
return .ECANCELED
#endif
Expand Down

0 comments on commit dd893fc

Please sign in to comment.