mirror of
https://github.com/apple/swift-system
synced 2026-11-26 04:57:54 +00:00
Use C type in typealias
This commit is contained in:
1 parent
b6558a3a90
commit
bae68a5651
1 file changed
+12
-10
@@ -14,19 +14,21 @@
|
||||
@available(*, deprecated, renamed: "CInterop.Mode")
|
||||
public typealias CModeT = CInterop.Mode
|
||||
|
||||
import CSystem
|
||||
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(Android)
|
||||
import Glibc
|
||||
#elseif os(Windows)
|
||||
import ucrt
|
||||
#else
|
||||
#error("Unsupported Platform")
|
||||
#endif
|
||||
|
||||
/// A namespace for C and platform types
|
||||
// @available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
|
||||
public enum CInterop {
|
||||
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
|
||||
/// The C `mode_t` type.
|
||||
public typealias Mode = UInt16
|
||||
#elseif os(Windows)
|
||||
/// The C `mode_t` type.
|
||||
public typealias Mode = Int32
|
||||
#else
|
||||
/// The C `mode_t` type.
|
||||
public typealias Mode = UInt32
|
||||
#endif
|
||||
public typealias Mode = mode_t
|
||||
|
||||
/// The C `char` type
|
||||
public typealias Char = CChar
|
||||
|
||||
Reference in new issue
Block a user