File tree Expand file tree Collapse file tree 1 file changed +9
-17
lines changed Expand file tree Collapse file tree 1 file changed +9
-17
lines changed Original file line number Diff line number Diff line change 10
10
//
11
11
//===----------------------------------------------------------------------===//
12
12
13
- #if canImport(Darwin)
13
+ #if canImport(MSVCRT)
14
+ import MSVCRT
15
+ import WinSDK
16
+ #elseif canImport(Darwin)
14
17
import Darwin
15
18
#elseif canImport(Glibc)
16
19
import Glibc
@@ -904,23 +907,12 @@ public struct POSIXError : _BridgedStoredNSError {
904
907
}
905
908
906
909
public static var _nsErrorDomain : String { return NSPOSIXErrorDomain }
910
+
911
+ public typealias Code = POSIXErrorCode
912
+ }
907
913
908
- public struct Code : Equatable , Hashable , RawRepresentable , _ErrorCodeProtocol {
909
- public typealias _ErrorType = POSIXError
910
- internal let errorCode : POSIXErrorCode
911
- public var rawValue : Int {
912
- return Int ( errorCode. rawValue)
913
- }
914
- public init ? ( rawValue: Int ) {
915
- guard rawValue <= Int ( Int32 . max) ,
916
- let errorCode = POSIXErrorCode ( rawValue: Int32 ( rawValue) )
917
- else { return nil }
918
- self . init ( errorCode: errorCode)
919
- }
920
- internal init ( errorCode: POSIXErrorCode ) {
921
- self . errorCode = errorCode
922
- }
923
- }
914
+ extension POSIXErrorCode : _ErrorCodeProtocol {
915
+ public typealias _ErrorType = POSIXError
924
916
}
925
917
926
918
extension POSIXError {
You can’t perform that action at this time.
0 commit comments