Skip to content

Commit 55350cd

Browse files
committed
Add availability to new CInterop typealiases
1 parent 87f8e49 commit 55350cd

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

Sources/System/FileSystem/FileFlags.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@
3939
// |------------------|---------------|---------------|---------------|
4040

4141
#if SYSTEM_PACKAGE_DARWIN || os(FreeBSD) || os(OpenBSD)
42-
@available(System 99, *)
43-
extension CInterop {
44-
public typealias FileFlags = UInt32
45-
}
4642

4743
/// File-specific flags found in the `st_flags` property of a `stat` struct
4844
/// or used as input to `chflags()`.

Sources/System/Internals/CInterop.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,18 @@ public enum CInterop {
7878
/// on API.
7979
public typealias PlatformUnicodeEncoding = UTF8
8080
#endif
81+
}
8182

82-
#if !os(Windows)
83+
#if !os(Windows)
84+
@available(System 99, *)
85+
extension CInterop {
8386
public typealias Stat = stat
8487
public typealias DeviceID = dev_t
8588
public typealias Inode = ino_t
8689
public typealias UserID = uid_t
8790
public typealias GroupID = gid_t
91+
#if SYSTEM_PACKAGE_DARWIN || os(FreeBSD) || os(OpenBSD)
92+
public typealias FileFlags = UInt32
8893
#endif
8994
}
95+
#endif

Sources/System/Internals/Exports.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,19 @@ internal func system_strlen(_ s: UnsafeMutablePointer<CChar>) -> Int {
9191
}
9292

9393
#if !os(Windows)
94+
@available(System 99, *)
9495
internal func system_stat(_ p: UnsafePointer<CChar>, _ s: inout CInterop.Stat) -> Int32 {
9596
stat(p, &s)
9697
}
98+
@available(System 99, *)
9799
internal func system_lstat(_ p: UnsafePointer<CChar>, _ s: inout CInterop.Stat) -> Int32 {
98100
lstat(p, &s)
99101
}
102+
@available(System 99, *)
100103
internal func system_fstat(_ fd: CInt, _ s: inout CInterop.Stat) -> Int32 {
101104
fstat(fd, &s)
102105
}
106+
@available(System 99, *)
103107
internal func system_fstatat(_ fd: CInt, _ p: UnsafePointer<CChar>, _ s: inout CInterop.Stat, _ flags: CInt) -> Int32 {
104108
fstatat(fd, p, &s, flags)
105109
}

0 commit comments

Comments
 (0)