diff --git a/Sources/Foundation/CGFloat.swift b/Sources/Foundation/CGFloat.swift index c59977f88a..425ab259fe 100644 --- a/Sources/Foundation/CGFloat.swift +++ b/Sources/Foundation/CGFloat.swift @@ -8,7 +8,7 @@ // #if canImport(Android) -import Android +@preconcurrency import Android #endif @frozen diff --git a/Sources/Foundation/FileHandle.swift b/Sources/Foundation/FileHandle.swift index 7a985f2ef8..191348df7d 100644 --- a/Sources/Foundation/FileHandle.swift +++ b/Sources/Foundation/FileHandle.swift @@ -20,12 +20,12 @@ fileprivate let _read = Darwin.read(_:_:_:) fileprivate let _write = Darwin.write(_:_:_:) fileprivate let _close = Darwin.close(_:) #elseif canImport(Glibc) -import Glibc +@preconcurrency import Glibc fileprivate let _read = Glibc.read(_:_:_:) fileprivate let _write = Glibc.write(_:_:_:) fileprivate let _close = Glibc.close(_:) #elseif canImport(Musl) -import Musl +@preconcurrency import Musl fileprivate let _read = Musl.read(_:_:_:) fileprivate let _write = Musl.write(_:_:_:) fileprivate let _close = Musl.close(_:) @@ -35,7 +35,7 @@ fileprivate let _read = WASILibc.read(_:_:_:) fileprivate let _write = WASILibc.write(_:_:_:) fileprivate let _close = WASILibc.close(_:) #elseif canImport(Android) -import Android +@preconcurrency import Android fileprivate let _read = Android.read(_:_:_:) fileprivate let _write = Android.write(_:_:_:) fileprivate let _close = Android.close(_:) diff --git a/Sources/Foundation/FileManager+POSIX.swift b/Sources/Foundation/FileManager+POSIX.swift index e51aba6e72..c16f9b3956 100644 --- a/Sources/Foundation/FileManager+POSIX.swift +++ b/Sources/Foundation/FileManager+POSIX.swift @@ -8,7 +8,7 @@ #if !os(Windows) #if canImport(Android) -import Android +@preconcurrency import Android #endif #if os(Android) && (arch(i386) || arch(arm)) // struct stat.st_mode is UInt32 diff --git a/Sources/Foundation/FileManager.swift b/Sources/Foundation/FileManager.swift index 54864b85b4..f5dd433579 100644 --- a/Sources/Foundation/FileManager.swift +++ b/Sources/Foundation/FileManager.swift @@ -22,7 +22,7 @@ import WinSDK #if os(WASI) import WASILibc #elseif canImport(Bionic) -import Bionic +@preconcurrency import Bionic #endif #if os(Windows) diff --git a/Sources/Foundation/Host.swift b/Sources/Foundation/Host.swift index 7b72fb6b10..1a4aeb415e 100644 --- a/Sources/Foundation/Host.swift +++ b/Sources/Foundation/Host.swift @@ -13,7 +13,7 @@ import WinSDK #endif #if canImport(Android) - import Android + @preconcurrency import Android // Android Bionic differs a little with respect to the Linux Glibc. // IFF_LOOPBACK is part of the enumeration net_device_flags, which needs to diff --git a/Sources/Foundation/NSData.swift b/Sources/Foundation/NSData.swift index 65eb0d93e2..1a076beff7 100644 --- a/Sources/Foundation/NSData.swift +++ b/Sources/Foundation/NSData.swift @@ -12,7 +12,7 @@ import Dispatch #endif #if canImport(Android) -import Android +@preconcurrency import Android #endif extension NSData { diff --git a/Sources/Foundation/NSError.swift b/Sources/Foundation/NSError.swift index 5d9d78672f..d6a4d1868c 100644 --- a/Sources/Foundation/NSError.swift +++ b/Sources/Foundation/NSError.swift @@ -13,11 +13,11 @@ #if canImport(Darwin) import Darwin #elseif canImport(Glibc) -import Glibc +@preconcurrency import Glibc #elseif canImport(CRT) import CRT #elseif canImport(Android) -import Android +@preconcurrency import Android #endif @_implementationOnly import CoreFoundation diff --git a/Sources/Foundation/NSLock.swift b/Sources/Foundation/NSLock.swift index 5a2d06bfe0..938074d9e5 100644 --- a/Sources/Foundation/NSLock.swift +++ b/Sources/Foundation/NSLock.swift @@ -10,9 +10,9 @@ @_implementationOnly import CoreFoundation #if canImport(Glibc) -import Glibc +@preconcurrency import Glibc #elseif canImport(Bionic) -import Bionic +@preconcurrency import Bionic #endif #if os(Windows) diff --git a/Sources/Foundation/NSPathUtilities.swift b/Sources/Foundation/NSPathUtilities.swift index ba8a48fad3..0c1c163adc 100644 --- a/Sources/Foundation/NSPathUtilities.swift +++ b/Sources/Foundation/NSPathUtilities.swift @@ -11,7 +11,7 @@ #if os(Windows) import WinSDK #elseif canImport(Android) -import Android +@preconcurrency import Android #elseif os(WASI) import WASILibc #endif diff --git a/Sources/Foundation/NSPlatform.swift b/Sources/Foundation/NSPlatform.swift index 6a4636453a..522375bef9 100644 --- a/Sources/Foundation/NSPlatform.swift +++ b/Sources/Foundation/NSPlatform.swift @@ -11,7 +11,7 @@ fileprivate let _NSPageSize = Int(vm_page_size) #elseif os(Linux) || os(Android) || os(OpenBSD) || os(FreeBSD) #if canImport(Android) -import Android +@preconcurrency import Android #endif fileprivate let _NSPageSize = Int(getpagesize()) diff --git a/Sources/Foundation/NSSwiftRuntime.swift b/Sources/Foundation/NSSwiftRuntime.swift index 1509c31d71..1276a03b80 100644 --- a/Sources/Foundation/NSSwiftRuntime.swift +++ b/Sources/Foundation/NSSwiftRuntime.swift @@ -16,11 +16,11 @@ internal import Synchronization #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) @_exported import Darwin #elseif canImport(Glibc) -@_exported import Glibc +@_exported @preconcurrency import Glibc #elseif canImport(Musl) -@_exported import Musl +@_exported @preconcurrency import Musl #elseif canImport(Bionic) -@_exported import Bionic +@_exported @preconcurrency import Bionic #elseif os(WASI) @_exported import WASILibc #elseif os(Windows) diff --git a/Sources/Foundation/NSURL.swift b/Sources/Foundation/NSURL.swift index a9972c1ac2..88f6cd1108 100644 --- a/Sources/Foundation/NSURL.swift +++ b/Sources/Foundation/NSURL.swift @@ -19,11 +19,11 @@ internal let kCFURLWindowsPathStyle = CFURLPathStyle.cfurlWindowsPathStyle #if canImport(Darwin) import Darwin #elseif canImport(Glibc) -import Glibc +@preconcurrency import Glibc #elseif canImport(Musl) -import Musl +@preconcurrency import Musl #elseif canImport(Bionic) -import Bionic +@preconcurrency import Bionic #endif // NOTE: this represents PLATFORM_PATH_STYLE diff --git a/Sources/Foundation/Port.swift b/Sources/Foundation/Port.swift index be7374a9a8..7dc582b3bb 100644 --- a/Sources/Foundation/Port.swift +++ b/Sources/Foundation/Port.swift @@ -108,19 +108,19 @@ fileprivate let FOUNDATION_IPPROTO_TCP = IPPROTO_TCP #endif #if canImport(Glibc) && !os(OpenBSD) && !os(FreeBSD) -import Glibc +@preconcurrency import Glibc fileprivate let FOUNDATION_SOCK_STREAM = Int32(SOCK_STREAM.rawValue) fileprivate let FOUNDATION_IPPROTO_TCP = Int32(IPPROTO_TCP) #endif #if canImport(Musl) -import Musl +@preconcurrency import Musl fileprivate let FOUNDATION_SOCK_STREAM = Int32(SOCK_STREAM) fileprivate let FOUNDATION_IPPROTO_TCP = Int32(IPPROTO_TCP) #endif #if canImport(Glibc) && (os(OpenBSD) || os(FreeBSD)) -import Glibc +@preconcurrency import Glibc fileprivate let FOUNDATION_SOCK_STREAM = Int32(SOCK_STREAM) fileprivate let FOUNDATION_IPPROTO_TCP = Int32(IPPROTO_TCP) fileprivate let INADDR_ANY: in_addr_t = 0 @@ -128,7 +128,7 @@ fileprivate let INADDR_LOOPBACK = 0x7f000001 #endif #if canImport(Android) -import Android +@preconcurrency import Android fileprivate let FOUNDATION_SOCK_STREAM = Int32(Android.SOCK_STREAM) fileprivate let FOUNDATION_IPPROTO_TCP = Int32(Android.IPPROTO_TCP) fileprivate let INADDR_ANY: in_addr_t = 0 diff --git a/Sources/Foundation/Process.swift b/Sources/Foundation/Process.swift index c3730cddf8..5bd3aabc5b 100644 --- a/Sources/Foundation/Process.swift +++ b/Sources/Foundation/Process.swift @@ -19,7 +19,7 @@ import struct WinSDK.HANDLE #if canImport(Darwin) import Darwin #elseif canImport(Android) -import Android +@preconcurrency import Android #endif internal import Synchronization diff --git a/Sources/Foundation/Thread.swift b/Sources/Foundation/Thread.swift index 4b9f3d1ddb..ac1aa0eed4 100644 --- a/Sources/Foundation/Thread.swift +++ b/Sources/Foundation/Thread.swift @@ -14,11 +14,11 @@ import WinSDK #endif #if canImport(Glibc) -import Glibc +@preconcurrency import Glibc #elseif canImport(Musl) -import Musl +@preconcurrency import Musl #elseif canImport(Bionic) -import Bionic +@preconcurrency import Bionic #endif // WORKAROUND_SR9811 diff --git a/Sources/FoundationNetworking/HTTPCookie.swift b/Sources/FoundationNetworking/HTTPCookie.swift index 237c1daf55..18a62776bb 100644 --- a/Sources/FoundationNetworking/HTTPCookie.swift +++ b/Sources/FoundationNetworking/HTTPCookie.swift @@ -16,7 +16,7 @@ import Foundation #if os(Windows) import WinSDK #elseif canImport(Android) -import Android +@preconcurrency import Android #endif public struct HTTPCookiePropertyKey : RawRepresentable, Equatable, Hashable, Sendable { diff --git a/Sources/Testing/Testing.swift b/Sources/Testing/Testing.swift index 2483c14ed6..601f9e28a5 100644 --- a/Sources/Testing/Testing.swift +++ b/Sources/Testing/Testing.swift @@ -8,11 +8,11 @@ // #if canImport(Glibc) -import Glibc +@preconcurrency import Glibc #elseif canImport(Musl) -import Musl +@preconcurrency import Musl #elseif canImport(Bionic) -import Bionic +@preconcurrency import Bionic #elseif os(WASI) import WASILibc #elseif canImport(CRT) diff --git a/Sources/XCTest/Public/XCTestMain.swift b/Sources/XCTest/Public/XCTestMain.swift index e19184e69f..2cfefbdbb5 100644 --- a/Sources/XCTest/Public/XCTestMain.swift +++ b/Sources/XCTest/Public/XCTestMain.swift @@ -27,7 +27,7 @@ #if canImport(Darwin) import Darwin #elseif canImport(Glibc) - import Glibc + @preconcurrency import Glibc #endif /// Starts a test run for the specified test cases. diff --git a/Sources/plutil/main.swift b/Sources/plutil/main.swift index 29584596d3..34b1d5e332 100644 --- a/Sources/plutil/main.swift +++ b/Sources/plutil/main.swift @@ -11,13 +11,13 @@ import Darwin import SwiftFoundation #elseif canImport(Glibc) import Foundation -import Glibc +@preconcurrency import Glibc #elseif canImport(Musl) import Foundation -import Musl +@preconcurrency import Musl #elseif canImport(Bionic) import Foundation -import Bionic +@preconcurrency import Bionic #elseif canImport(CRT) import Foundation import CRT diff --git a/Sources/xdgTestHelper/main.swift b/Sources/xdgTestHelper/main.swift index fb037e2435..769ac33882 100644 --- a/Sources/xdgTestHelper/main.swift +++ b/Sources/xdgTestHelper/main.swift @@ -20,7 +20,7 @@ import FoundationNetworking #if os(Windows) import WinSDK #elseif canImport(Android) -import Android +@preconcurrency import Android #endif enum HelperCheckStatus : Int32 { diff --git a/Tests/Foundation/FTPServer.swift b/Tests/Foundation/FTPServer.swift index 8328a7ff7e..8a27a210b2 100644 --- a/Tests/Foundation/FTPServer.swift +++ b/Tests/Foundation/FTPServer.swift @@ -12,11 +12,11 @@ import Dispatch #if canImport(Glibc) - import Glibc + @preconcurrency import Glibc #elseif canImport(Darwin) import Darwin #elseif canImport(Android) - import Android + @preconcurrency import Android #endif final class ServerSemaphore : Sendable { diff --git a/Tests/Foundation/HTTPServer.swift b/Tests/Foundation/HTTPServer.swift index f5459ff4b3..a6457f285f 100644 --- a/Tests/Foundation/HTTPServer.swift +++ b/Tests/Foundation/HTTPServer.swift @@ -20,9 +20,9 @@ import Dispatch #elseif canImport(Darwin) import Darwin #elseif canImport(Glibc) - import Glibc + @preconcurrency import Glibc #elseif canImport(Android) - import Android + @preconcurrency import Android #endif #if !os(Windows) diff --git a/Tests/Foundation/TestFileHandle.swift b/Tests/Foundation/TestFileHandle.swift index 8650c207e2..aa36f3ccde 100644 --- a/Tests/Foundation/TestFileHandle.swift +++ b/Tests/Foundation/TestFileHandle.swift @@ -20,7 +20,7 @@ import Dispatch #if os(Windows) import WinSDK #elseif canImport(Android) -import Android +@preconcurrency import Android #endif class TestFileHandle : XCTestCase { diff --git a/Tests/Foundation/TestNSData.swift b/Tests/Foundation/TestNSData.swift index fc829994c7..83a6bbadde 100644 --- a/Tests/Foundation/TestNSData.swift +++ b/Tests/Foundation/TestNSData.swift @@ -11,7 +11,7 @@ import XCTest @testable import Foundation #if canImport(Android) -import Android +@preconcurrency import Android #endif class TestNSData: XCTestCase { diff --git a/Tests/Foundation/TestProcess.swift b/Tests/Foundation/TestProcess.swift index 219ae8b658..caa1fa9d20 100644 --- a/Tests/Foundation/TestProcess.swift +++ b/Tests/Foundation/TestProcess.swift @@ -9,7 +9,7 @@ import Synchronization #if canImport(Android) -import Android +@preconcurrency import Android #endif class TestProcess : XCTestCase { diff --git a/Tests/Foundation/TestSocketPort.swift b/Tests/Foundation/TestSocketPort.swift index 0a6ec281a9..521d809b25 100644 --- a/Tests/Foundation/TestSocketPort.swift +++ b/Tests/Foundation/TestSocketPort.swift @@ -9,7 +9,7 @@ #if os(Windows) import WinSDK #elseif canImport(Android) -import Android +@preconcurrency import Android #endif class TestPortDelegateWithBlock: NSObject, PortDelegate { diff --git a/Tests/Foundation/TestURL.swift b/Tests/Foundation/TestURL.swift index cfd5eb258f..36f9e38f67 100644 --- a/Tests/Foundation/TestURL.swift +++ b/Tests/Foundation/TestURL.swift @@ -8,7 +8,7 @@ // #if canImport(Android) -import Android +@preconcurrency import Android #endif let kURLTestParsingTestsKey = "ParsingTests"