Files
swift-system/Sources/System/Platform/Platform.swift
T
Michael Ilseman 920ef3085d Add PlatformString and Windows support
Add CInterop namespace and PlatformChar/PlatformEncoding typealiases for
narrow/wide characters.

Change Windows syscalls to use wide-character variants. Add full Windows root
parser to error-correct malformed roots and correctly normalize roots and
post-root portions of the path.

Add platformString APIs as replacements for cString APIs.

Add internal SystemString as backing storage type for FilePath.

Add Windows path mocking support.

This change includes API/ABI additions and deprecations.
2021-02-01 08:20:05 -07:00

35 lines
961 B
Swift

/*
This source file is part of the Swift System open source project
Copyright (c) 2020 Apple Inc. and the Swift System project authors
Licensed under Apache License v2.0 with Runtime Library Exception
See https://swift.org/LICENSE.txt for license information
*/
@_implementationOnly import SystemInternals
// Public typealiases that can't be reexported from SystemInternals
/// The C `mode_t` type.
// @available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
@available(*, deprecated, renamed: "CInterop.Mode")
public typealias CModeT = CInterop.Mode
/// A namespace for C and platform types
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
/// The C `char` type
public typealias Char = CChar
}