We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 872d07f + 3581bff commit f7f0d74Copy full SHA for f7f0d74
Sources/POSIX/Error.swift
@@ -35,22 +35,14 @@ public enum SystemError: ErrorType {
35
case waitpid(Int32)
36
}
37
38
-#if os(OSX)
39
- import func Darwin.strerror
40
-#else
41
- import func Glibc.strerror
42
-#endif
+import func libc.strerror
43
44
45
extension SystemError: CustomStringConvertible {
46
public var description: String {
47
48
func strerror(errno: Int32) -> String {
49
- #if os(OSX)
50
- let cmsg = Darwin.strerror(errno)
51
- #else
52
- let cmsg = Glibc.strerror(errno)
53
- #endif
+ let cmsg = libc.strerror(errno)
54
let msg = String.fromCString(cmsg) ?? "Unknown Error"
55
return "\(msg) (\(errno))"
56
0 commit comments