mirror of
https://github.com/apple/swift-system
synced 2026-11-25 04:47:55 +00:00
Add availability to new CInterop typealiases
This commit is contained in:
3 files changed
+11
-5
No files matched your search
@@ -39,10 +39,6 @@
|
||||
// |------------------|---------------|---------------|---------------|
|
||||
|
||||
#if SYSTEM_PACKAGE_DARWIN || os(FreeBSD) || os(OpenBSD)
|
||||
@available(System 99, *)
|
||||
extension CInterop {
|
||||
public typealias FileFlags = UInt32
|
||||
}
|
||||
|
||||
/// File-specific flags found in the `st_flags` property of a `stat` struct
|
||||
/// or used as input to `chflags()`.
|
||||
|
||||
@@ -78,12 +78,18 @@ public enum CInterop {
|
||||
/// on API.
|
||||
public typealias PlatformUnicodeEncoding = UTF8
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !os(Windows)
|
||||
#if !os(Windows)
|
||||
@available(System 99, *)
|
||||
extension CInterop {
|
||||
public typealias Stat = stat
|
||||
public typealias DeviceID = dev_t
|
||||
public typealias Inode = ino_t
|
||||
public typealias UserID = uid_t
|
||||
public typealias GroupID = gid_t
|
||||
#if SYSTEM_PACKAGE_DARWIN || os(FreeBSD) || os(OpenBSD)
|
||||
public typealias FileFlags = UInt32
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
@@ -91,15 +91,19 @@ internal func system_strlen(_ s: UnsafeMutablePointer<CChar>) -> Int {
|
||||
}
|
||||
|
||||
#if !os(Windows)
|
||||
@available(System 99, *)
|
||||
internal func system_stat(_ p: UnsafePointer<CChar>, _ s: inout CInterop.Stat) -> Int32 {
|
||||
stat(p, &s)
|
||||
}
|
||||
@available(System 99, *)
|
||||
internal func system_lstat(_ p: UnsafePointer<CChar>, _ s: inout CInterop.Stat) -> Int32 {
|
||||
lstat(p, &s)
|
||||
}
|
||||
@available(System 99, *)
|
||||
internal func system_fstat(_ fd: CInt, _ s: inout CInterop.Stat) -> Int32 {
|
||||
fstat(fd, &s)
|
||||
}
|
||||
@available(System 99, *)
|
||||
internal func system_fstatat(_ fd: CInt, _ p: UnsafePointer<CChar>, _ s: inout CInterop.Stat, _ flags: CInt) -> Int32 {
|
||||
fstatat(fd, p, &s, flags)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user