Skip to content

Commit bdfeb29

Browse files
authored
Internals: adjust the definition of CInterop.Mode for Windows (#36)
Windows does not have a `mode_t` type, instead it uses `int` as a stand in. Adjust the type alias to reflect this.
1 parent 8387561 commit bdfeb29

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Sources/System/Internals/CInterop.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ import ucrt
2929
/// A namespace for C and platform types
3030
// @available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
3131
public enum CInterop {
32+
#if os(Windows)
33+
public typealias Mode = CInt
34+
#else
3235
public typealias Mode = mode_t
36+
#endif
3337

3438
/// The C `char` type
3539
public typealias Char = CChar

0 commit comments

Comments
 (0)