Skip to content

Commit 2ac0cdc

Browse files
authored
Merge pull request #29 from milseman/bypassing_customs
Normal imports
2 parents 16667a3 + 8b989f7 commit 2ac0cdc

10 files changed

+500
-1267
lines changed

Sources/System/Platform/Platform.swift renamed to Sources/System/Internals/CInterop.swift

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,22 @@
1414
@available(*, deprecated, renamed: "CInterop.Mode")
1515
public typealias CModeT = CInterop.Mode
1616

17+
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
18+
import Darwin
19+
#elseif os(Linux) || os(FreeBSD) || os(Android)
20+
import CSystem
21+
import Glibc
22+
#elseif os(Windows)
23+
import CSystem
24+
import ucrt
25+
#else
26+
#error("Unsupported Platform")
27+
#endif
28+
1729
/// A namespace for C and platform types
1830
// @available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
1931
public enum CInterop {
20-
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
21-
/// The C `mode_t` type.
22-
public typealias Mode = UInt16
23-
#elseif os(Windows)
24-
/// The C `mode_t` type.
25-
public typealias Mode = Int32
26-
#else
27-
/// The C `mode_t` type.
28-
public typealias Mode = UInt32
29-
#endif
32+
public typealias Mode = mode_t
3033

3134
/// The C `char` type
3235
public typealias Char = CChar

0 commit comments

Comments
 (0)