From 4ebe7c0c07264f15dd9729e21e00be42ac33b0e3 Mon Sep 17 00:00:00 2001 From: brennobemoura <37243584+brennobemoura@users.noreply.github.com> Date: Thu, 22 Jun 2023 09:42:10 -0300 Subject: [PATCH 1/2] Replace os() with canImport(Darwin) --- Sources/AsyncHTTPClient/Base64.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/AsyncHTTPClient/Base64.swift b/Sources/AsyncHTTPClient/Base64.swift index dbbf742ab..a35179235 100644 --- a/Sources/AsyncHTTPClient/Base64.swift +++ b/Sources/AsyncHTTPClient/Base64.swift @@ -150,7 +150,7 @@ extension String { // this declaration on having the 5.3 compiler. This has caused a number of build issues. While updating // to newer Xcodes does work, we can save ourselves some hassle and just wait until 5.4 to get this // enhancement on Apple platforms. -#if (compiler(>=5.3) && !(os(macOS) || os(iOS) || os(tvOS) || os(watchOS))) || compiler(>=5.4) +#if (compiler(>=5.3) && !canImport(Darwin)) || compiler(>=5.4) extension String { @inlinable From f5b93cb466878849b00c8b6f770bd65211e94d00 Mon Sep 17 00:00:00 2001 From: brennobemoura <37243584+brennobemoura@users.noreply.github.com> Date: Fri, 23 Jun 2023 06:45:46 -0300 Subject: [PATCH 2/2] Remove compilation conditional since it'll always be true --- Sources/AsyncHTTPClient/Base64.swift | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/Sources/AsyncHTTPClient/Base64.swift b/Sources/AsyncHTTPClient/Base64.swift index a35179235..eed511a8c 100644 --- a/Sources/AsyncHTTPClient/Base64.swift +++ b/Sources/AsyncHTTPClient/Base64.swift @@ -146,11 +146,6 @@ extension String { } } -// Frustratingly, Swift 5.3 shipped before the macOS 11 SDK did, so we cannot gate the availability of -// this declaration on having the 5.3 compiler. This has caused a number of build issues. While updating -// to newer Xcodes does work, we can save ourselves some hassle and just wait until 5.4 to get this -// enhancement on Apple platforms. -#if (compiler(>=5.3) && !canImport(Darwin)) || compiler(>=5.4) extension String { @inlinable @@ -163,12 +158,3 @@ extension String { } } } -#else -extension String { - @inlinable - init(customUnsafeUninitializedCapacity capacity: Int, - initializingUTF8With initializer: (_ buffer: UnsafeMutableBufferPointer) throws -> Int) rethrows { - try self.init(backportUnsafeUninitializedCapacity: capacity, initializingUTF8With: initializer) - } -} -#endif