mirror of
https://github.com/apple/swift-system
synced 2026-11-27 05:04:27 +00:00
Merge pull request #212 from michael-yuji/freebsd-wip
Guard errnos not available on FreeBSD
This commit is contained in:
4 files changed
+13
-9
No files matched your search
@@ -1294,7 +1294,7 @@ public struct Errno: RawRepresentable, Error, Hashable, Codable {
|
||||
@available(*, unavailable, renamed: "multiHop")
|
||||
public static var EMULTIHOP: Errno { multiHop }
|
||||
|
||||
#if !os(WASI)
|
||||
#if !os(WASI) && !os(FreeBSD)
|
||||
/// No message available.
|
||||
///
|
||||
/// No message was available to be received by the requested operation.
|
||||
@@ -1320,7 +1320,7 @@ public struct Errno: RawRepresentable, Error, Hashable, Codable {
|
||||
@available(*, unavailable, renamed: "noLink")
|
||||
public static var ENOLINK: Errno { noLink }
|
||||
|
||||
#if !os(WASI)
|
||||
#if !os(WASI) && !os(FreeBSD)
|
||||
/// Reserved.
|
||||
///
|
||||
/// This error is reserved for future use.
|
||||
@@ -1361,7 +1361,7 @@ public struct Errno: RawRepresentable, Error, Hashable, Codable {
|
||||
@available(*, unavailable, renamed: "protocolError")
|
||||
public static var EPROTO: Errno { protocolError }
|
||||
|
||||
#if !os(OpenBSD) && !os(WASI)
|
||||
#if !os(OpenBSD) && !os(WASI) && !os(FreeBSD)
|
||||
/// Reserved.
|
||||
///
|
||||
/// This error is reserved for future use.
|
||||
|
||||
@@ -422,7 +422,7 @@ internal var _EBADMSG: CInt { EBADMSG }
|
||||
@_alwaysEmitIntoClient
|
||||
internal var _EMULTIHOP: CInt { EMULTIHOP }
|
||||
|
||||
#if !os(WASI)
|
||||
#if !os(WASI) && !os(FreeBSD)
|
||||
@_alwaysEmitIntoClient
|
||||
internal var _ENODATA: CInt { ENODATA }
|
||||
#endif
|
||||
@@ -430,7 +430,7 @@ internal var _ENODATA: CInt { ENODATA }
|
||||
@_alwaysEmitIntoClient
|
||||
internal var _ENOLINK: CInt { ENOLINK }
|
||||
|
||||
#if !os(WASI)
|
||||
#if !os(WASI) && !os(FreeBSD)
|
||||
@_alwaysEmitIntoClient
|
||||
internal var _ENOSR: CInt { ENOSR }
|
||||
|
||||
@@ -442,7 +442,7 @@ internal var _ENOSTR: CInt { ENOSTR }
|
||||
@_alwaysEmitIntoClient
|
||||
internal var _EPROTO: CInt { EPROTO }
|
||||
|
||||
#if !os(OpenBSD) && !os(WASI)
|
||||
#if !os(OpenBSD) && !os(WASI) && !os(FreeBSD)
|
||||
@_alwaysEmitIntoClient
|
||||
internal var _ETIME: CInt { ETIME }
|
||||
#endif
|
||||
|
||||
@@ -191,7 +191,7 @@ internal func system_confstr(
|
||||
internal let SYSTEM_AT_REMOVE_DIR = AT_REMOVEDIR
|
||||
internal let SYSTEM_DT_DIR = DT_DIR
|
||||
internal typealias system_dirent = dirent
|
||||
#if os(Linux) || os(Android)
|
||||
#if os(Linux) || os(Android) || os(FreeBSD)
|
||||
internal typealias system_DIRPtr = OpaquePointer
|
||||
#else
|
||||
internal typealias system_DIRPtr = UnsafeMutablePointer<DIR>
|
||||
|
||||
@@ -164,13 +164,17 @@ final class ErrnoTest: XCTestCase {
|
||||
#if !os(Windows)
|
||||
XCTAssert(EBADMSG == Errno.badMessage.rawValue)
|
||||
XCTAssert(EMULTIHOP == Errno.multiHop.rawValue)
|
||||
XCTAssert(ENODATA == Errno.noData.rawValue)
|
||||
XCTAssert(ENOLINK == Errno.noLink.rawValue)
|
||||
XCTAssert(EPROTO == Errno.protocolError.rawValue)
|
||||
#endif
|
||||
|
||||
#if !os(Windows) && !os(FreeBSD)
|
||||
XCTAssert(ENODATA == Errno.noData.rawValue)
|
||||
XCTAssert(ENOSR == Errno.noStreamResources.rawValue)
|
||||
XCTAssert(ENOSTR == Errno.notStream.rawValue)
|
||||
XCTAssert(EPROTO == Errno.protocolError.rawValue)
|
||||
XCTAssert(ETIME == Errno.timeout.rawValue)
|
||||
#endif
|
||||
|
||||
XCTAssert(EOPNOTSUPP == Errno.notSupportedOnSocket.rawValue)
|
||||
|
||||
// From headers but not man page
|
||||
|
||||
Reference in new issue
Block a user