Skip to content

Commit 721eabc

Browse files
authored
always @preconcurrency import Glibc/Musl/Android/Bionic/WASILibc [6.1] (#5177)
1 parent 0b8ed50 commit 721eabc

20 files changed

+43
-43
lines changed

Sources/Foundation/CGFloat.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//
99

1010
#if canImport(Android)
11-
import Android
11+
@preconcurrency import Android
1212
#endif
1313

1414
@frozen

Sources/Foundation/FileHandle.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,22 @@ fileprivate let _read = Darwin.read(_:_:_:)
2020
fileprivate let _write = Darwin.write(_:_:_:)
2121
fileprivate let _close = Darwin.close(_:)
2222
#elseif canImport(Glibc)
23-
import Glibc
23+
@preconcurrency import Glibc
2424
fileprivate let _read = Glibc.read(_:_:_:)
2525
fileprivate let _write = Glibc.write(_:_:_:)
2626
fileprivate let _close = Glibc.close(_:)
2727
#elseif canImport(Musl)
28-
import Musl
28+
@preconcurrency import Musl
2929
fileprivate let _read = Musl.read(_:_:_:)
3030
fileprivate let _write = Musl.write(_:_:_:)
3131
fileprivate let _close = Musl.close(_:)
3232
#elseif canImport(WASILibc)
33-
import WASILibc
33+
@preconcurrency import WASILibc
3434
fileprivate let _read = WASILibc.read(_:_:_:)
3535
fileprivate let _write = WASILibc.write(_:_:_:)
3636
fileprivate let _close = WASILibc.close(_:)
3737
#elseif canImport(Android)
38-
import Android
38+
@preconcurrency import Android
3939
fileprivate let _read = Android.read(_:_:_:)
4040
fileprivate let _write = Android.write(_:_:_:)
4141
fileprivate let _close = Android.close(_:)

Sources/Foundation/FileManager+POSIX.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#if !os(Windows)
99

1010
#if canImport(Android)
11-
import Android
11+
@preconcurrency import Android
1212
#endif
1313

1414
#if os(Android) && (arch(i386) || arch(arm)) // struct stat.st_mode is UInt32
@@ -21,7 +21,7 @@ internal func &(left: UInt32, right: mode_t) -> mode_t {
2121
internal import Synchronization
2222

2323
#if os(WASI)
24-
import WASILibc
24+
@preconcurrency import WASILibc
2525
// wasi-libc defines the following constants in a way that Clang Importer can't
2626
// understand, so we need to grab them manually through ForSwiftFoundationOnly.h
2727
internal var DT_DIR: UInt8 { _getConst_DT_DIR() }

Sources/Foundation/FileManager.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ import WinSDK
2020
#endif
2121

2222
#if os(WASI)
23-
import WASILibc
23+
@preconcurrency import WASILibc
2424
#elseif canImport(Bionic)
25-
import Bionic
25+
@preconcurrency import Bionic
2626
#endif
2727

2828
#if os(Windows)

Sources/Foundation/Host.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import WinSDK
1313
#endif
1414

1515
#if canImport(Android)
16-
import Android
16+
@preconcurrency import Android
1717
// Android Bionic differs a little with respect to the Linux Glibc.
1818

1919
// IFF_LOOPBACK is part of the enumeration net_device_flags, which needs to

Sources/Foundation/NSData.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import Dispatch
1313
#endif
1414
#if canImport(Android)
15-
import Android
15+
@preconcurrency import Android
1616
#endif
1717

1818
extension NSData {

Sources/Foundation/NSError.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
#if canImport(Darwin)
1414
import Darwin
1515
#elseif canImport(Glibc)
16-
import Glibc
16+
@preconcurrency import Glibc
1717
#elseif canImport(CRT)
1818
import CRT
1919
#elseif canImport(Android)
20-
import Android
20+
@preconcurrency import Android
2121
#endif
2222

2323
@_implementationOnly import CoreFoundation

Sources/Foundation/NSLock.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
@_implementationOnly import CoreFoundation
1111

1212
#if canImport(Glibc)
13-
import Glibc
13+
@preconcurrency import Glibc
1414
#elseif canImport(Bionic)
15-
import Bionic
15+
@preconcurrency import Bionic
1616
#endif
1717

1818
#if os(Windows)

Sources/Foundation/NSPathUtilities.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
#if os(Windows)
1212
import WinSDK
1313
#elseif canImport(Android)
14-
import Android
14+
@preconcurrency import Android
1515
#elseif os(WASI)
16-
import WASILibc
16+
@preconcurrency import WASILibc
1717
#endif
1818

1919
#if os(Windows)

Sources/Foundation/NSPlatform.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
fileprivate let _NSPageSize = Int(vm_page_size)
1212
#elseif os(Linux) || os(Android) || os(OpenBSD)
1313
#if canImport(Android)
14-
import Android
14+
@preconcurrency import Android
1515
#endif
1616
fileprivate let _NSPageSize = Int(getpagesize())
1717
#elseif os(Windows)

Sources/Foundation/NSSwiftRuntime.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ internal import Synchronization
1616
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
1717
@_exported import Darwin
1818
#elseif canImport(Glibc)
19-
@_exported import Glibc
19+
@_exported @preconcurrency import Glibc
2020
#elseif canImport(Musl)
21-
@_exported import Musl
21+
@_exported @preconcurrency import Musl
2222
#elseif canImport(Bionic)
23-
@_exported import Bionic
23+
@_exported @preconcurrency import Bionic
2424
#elseif os(WASI)
25-
@_exported import WASILibc
25+
@_exported @preconcurrency import WASILibc
2626
#elseif os(Windows)
2727
@_exported import CRT
2828
#endif

Sources/Foundation/NSURL.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ internal let kCFURLWindowsPathStyle = CFURLPathStyle.cfurlWindowsPathStyle
1919
#if canImport(Darwin)
2020
import Darwin
2121
#elseif canImport(Glibc)
22-
import Glibc
22+
@preconcurrency import Glibc
2323
#elseif canImport(Musl)
24-
import Musl
24+
@preconcurrency import Musl
2525
#elseif canImport(Bionic)
26-
import Bionic
26+
@preconcurrency import Bionic
2727
#endif
2828

2929
// NOTE: this represents PLATFORM_PATH_STYLE

Sources/Foundation/Port.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,27 +108,27 @@ fileprivate let FOUNDATION_IPPROTO_TCP = IPPROTO_TCP
108108
#endif
109109

110110
#if canImport(Glibc) && !os(OpenBSD)
111-
import Glibc
111+
@preconcurrency import Glibc
112112
fileprivate let FOUNDATION_SOCK_STREAM = Int32(SOCK_STREAM.rawValue)
113113
fileprivate let FOUNDATION_IPPROTO_TCP = Int32(IPPROTO_TCP)
114114
#endif
115115

116116
#if canImport(Musl)
117-
import Musl
117+
@preconcurrency import Musl
118118
fileprivate let FOUNDATION_SOCK_STREAM = Int32(SOCK_STREAM)
119119
fileprivate let FOUNDATION_IPPROTO_TCP = Int32(IPPROTO_TCP)
120120
#endif
121121

122122
#if canImport(Glibc) && os(OpenBSD)
123-
import Glibc
123+
@preconcurrency import Glibc
124124
fileprivate let FOUNDATION_SOCK_STREAM = Int32(SOCK_STREAM)
125125
fileprivate let FOUNDATION_IPPROTO_TCP = Int32(IPPROTO_TCP)
126126
fileprivate let INADDR_ANY: in_addr_t = 0
127127
fileprivate let INADDR_LOOPBACK = 0x7f000001
128128
#endif
129129

130130
#if canImport(Android)
131-
import Android
131+
@preconcurrency import Android
132132
fileprivate let FOUNDATION_SOCK_STREAM = Int32(Android.SOCK_STREAM)
133133
fileprivate let FOUNDATION_IPPROTO_TCP = Int32(Android.IPPROTO_TCP)
134134
fileprivate let INADDR_ANY: in_addr_t = 0

Sources/Foundation/Process.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import struct WinSDK.HANDLE
1919
#if canImport(Darwin)
2020
import Darwin
2121
#elseif canImport(Android)
22-
import Android
22+
@preconcurrency import Android
2323
#endif
2424

2525
internal import Synchronization

Sources/Foundation/Thread.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ import WinSDK
1414
#endif
1515

1616
#if canImport(Glibc)
17-
import Glibc
17+
@preconcurrency import Glibc
1818
#elseif canImport(Musl)
19-
import Musl
19+
@preconcurrency import Musl
2020
#elseif canImport(Bionic)
21-
import Bionic
21+
@preconcurrency import Bionic
2222
#endif
2323

2424
// WORKAROUND_SR9811

Sources/FoundationNetworking/HTTPCookie.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import Foundation
1616
#if os(Windows)
1717
import WinSDK
1818
#elseif canImport(Android)
19-
import Android
19+
@preconcurrency import Android
2020
#endif
2121

2222
public struct HTTPCookiePropertyKey : RawRepresentable, Equatable, Hashable, Sendable {

Sources/Testing/Testing.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
//
99

1010
#if canImport(Glibc)
11-
import Glibc
11+
@preconcurrency import Glibc
1212
#elseif canImport(Musl)
13-
import Musl
13+
@preconcurrency import Musl
1414
#elseif canImport(Bionic)
15-
import Bionic
15+
@preconcurrency import Bionic
1616
#elseif os(WASI)
17-
import WASILibc
17+
@preconcurrency import WASILibc
1818
#elseif canImport(CRT)
1919
import CRT
2020
#endif

Sources/XCTest/Public/XCTestMain.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#if canImport(Darwin)
2828
import Darwin
2929
#elseif canImport(Glibc)
30-
import Glibc
30+
@preconcurrency import Glibc
3131
#endif
3232

3333
/// Starts a test run for the specified test cases.

Sources/plutil/main.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ import Darwin
1111
import SwiftFoundation
1212
#elseif canImport(Glibc)
1313
import Foundation
14-
import Glibc
14+
@preconcurrency import Glibc
1515
#elseif canImport(Musl)
1616
import Foundation
17-
import Musl
17+
@preconcurrency import Musl
1818
#elseif canImport(Bionic)
1919
import Foundation
20-
import Bionic
20+
@preconcurrency import Bionic
2121
#elseif canImport(CRT)
2222
import Foundation
2323
import CRT

Sources/xdgTestHelper/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import FoundationNetworking
2020
#if os(Windows)
2121
import WinSDK
2222
#elseif canImport(Android)
23-
import Android
23+
@preconcurrency import Android
2424
#endif
2525

2626
enum HelperCheckStatus : Int32 {

0 commit comments

Comments
 (0)