mirror of
https://github.com/apple/swift-system
synced 2026-11-26 04:57:54 +00:00
Support OpenBSD. (#113)
Add the usual `os` conditionals and exclude errno constants that aren't present on this platform. Maybe availability annotations are a better way to deal with this, but that is likely something that requires more careful consideration.
This commit is contained in:
1 parent
252c0f0905
commit
18cceda484
5 files changed
+12
-4
No files matched your search
@@ -1274,6 +1274,7 @@ public struct Errno: RawRepresentable, Error, Hashable, Codable {
|
||||
@available(*, unavailable, renamed: "badMessage")
|
||||
public static var EBADMSG: Errno { badMessage }
|
||||
|
||||
#if !os(OpenBSD)
|
||||
/// Reserved.
|
||||
///
|
||||
/// This error is reserved for future use.
|
||||
@@ -1333,6 +1334,7 @@ public struct Errno: RawRepresentable, Error, Hashable, Codable {
|
||||
@_alwaysEmitIntoClient
|
||||
@available(*, unavailable, renamed: "notStream")
|
||||
public static var ENOSTR: Errno { notStream }
|
||||
#endif
|
||||
|
||||
/// Protocol error.
|
||||
///
|
||||
@@ -1348,6 +1350,7 @@ public struct Errno: RawRepresentable, Error, Hashable, Codable {
|
||||
@available(*, unavailable, renamed: "protocolError")
|
||||
public static var EPROTO: Errno { protocolError }
|
||||
|
||||
#if !os(OpenBSD)
|
||||
/// Reserved.
|
||||
///
|
||||
/// This error is reserved for future use.
|
||||
@@ -1359,6 +1362,7 @@ public struct Errno: RawRepresentable, Error, Hashable, Codable {
|
||||
@_alwaysEmitIntoClient
|
||||
@available(*, unavailable, renamed: "timeout")
|
||||
public static var ETIME: Errno { timeout }
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/// Operation not supported on socket.
|
||||
|
||||
@@ -16,7 +16,7 @@ public typealias CModeT = CInterop.Mode
|
||||
|
||||
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(Android)
|
||||
#elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os(Android)
|
||||
@_implementationOnly import CSystem
|
||||
import Glibc
|
||||
#elseif os(Windows)
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(Android)
|
||||
#elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os(Android)
|
||||
import Glibc
|
||||
#elseif os(Windows)
|
||||
import CSystem
|
||||
@@ -392,6 +392,7 @@ internal var _ENOATTR: CInt { ENOATTR }
|
||||
@_alwaysEmitIntoClient
|
||||
internal var _EBADMSG: CInt { EBADMSG }
|
||||
|
||||
#if !os(OpenBSD)
|
||||
@_alwaysEmitIntoClient
|
||||
internal var _EMULTIHOP: CInt { EMULTIHOP }
|
||||
|
||||
@@ -406,13 +407,16 @@ internal var _ENOSR: CInt { ENOSR }
|
||||
|
||||
@_alwaysEmitIntoClient
|
||||
internal var _ENOSTR: CInt { ENOSTR }
|
||||
#endif
|
||||
|
||||
@_alwaysEmitIntoClient
|
||||
internal var _EPROTO: CInt { EPROTO }
|
||||
|
||||
#if !os(OpenBSD)
|
||||
@_alwaysEmitIntoClient
|
||||
internal var _ETIME: CInt { ETIME }
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@_alwaysEmitIntoClient
|
||||
internal var _EOPNOTSUPP: CInt { EOPNOTSUPP }
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(Android)
|
||||
#elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os(Android)
|
||||
@_implementationOnly import CSystem
|
||||
import Glibc
|
||||
#elseif os(Windows)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(Android)
|
||||
#elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os(Android)
|
||||
import Glibc
|
||||
#elseif os(Windows)
|
||||
import ucrt
|
||||
|
||||
Reference in new issue
Block a user