From 8b989f724f3bbe1d4517ea4a79cf70da79a60217 Mon Sep 17 00:00:00 2001 From: Michael Ilseman Date: Sat, 27 Feb 2021 10:59:37 -0700 Subject: [PATCH] Do not import CSystem on Darwin --- .../{Platform/Platform.swift => Internals/CInterop.swift} | 3 ++- Sources/System/Internals/Constants.swift | 3 ++- Sources/System/Internals/Exports.swift | 4 ++-- Sources/System/{Platform => }/PlatformString.swift | 0 4 files changed, 6 insertions(+), 4 deletions(-) rename Sources/System/{Platform/Platform.swift => Internals/CInterop.swift} (99%) rename Sources/System/{Platform => }/PlatformString.swift (100%) diff --git a/Sources/System/Platform/Platform.swift b/Sources/System/Internals/CInterop.swift similarity index 99% rename from Sources/System/Platform/Platform.swift rename to Sources/System/Internals/CInterop.swift index 06ec50b..892a2d9 100644 --- a/Sources/System/Platform/Platform.swift +++ b/Sources/System/Internals/CInterop.swift @@ -14,12 +14,13 @@ @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 CSystem import Glibc #elseif os(Windows) +import CSystem import ucrt #else #error("Unsupported Platform") diff --git a/Sources/System/Internals/Constants.swift b/Sources/System/Internals/Constants.swift index 9005926..22bdf48 100644 --- a/Sources/System/Internals/Constants.swift +++ b/Sources/System/Internals/Constants.swift @@ -11,12 +11,13 @@ // they can be used anywhere without imports and without confusion to // unavailable local decls. -import CSystem #if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) import Darwin #elseif os(Linux) || os(FreeBSD) || os(Android) +import CSystem import Glibc #elseif os(Windows) +import CSystem import ucrt #else #error("Unsupported Platform") diff --git a/Sources/System/Internals/Exports.swift b/Sources/System/Internals/Exports.swift index 6d35e40..5ed7d4e 100644 --- a/Sources/System/Internals/Exports.swift +++ b/Sources/System/Internals/Exports.swift @@ -7,8 +7,6 @@ See https://swift.org/LICENSE.txt for license information */ -import CSystem - // Internal wrappers and typedefs which help reduce #if littering in System's // code base. @@ -17,8 +15,10 @@ import CSystem #if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) import Darwin #elseif os(Linux) || os(FreeBSD) || os(Android) +import CSystem import Glibc #elseif os(Windows) +import CSystem import ucrt #else #error("Unsupported Platform") diff --git a/Sources/System/Platform/PlatformString.swift b/Sources/System/PlatformString.swift similarity index 100% rename from Sources/System/Platform/PlatformString.swift rename to Sources/System/PlatformString.swift