Skip to content

Commit

Permalink
always @preconcurrency import Glibc/Musl
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Weiss committed Feb 15, 2025
1 parent bb396c4 commit 1edd7a0
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions Sources/Foundation/FileHandle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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(_:)
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/FileManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import WinSDK
#if os(WASI)
import WASILibc
#elseif canImport(Bionic)
import Bionic
@preconcurrency import Bionic
#endif

#if os(Windows)
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/NSError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#if canImport(Darwin)
import Darwin
#elseif canImport(Glibc)
import Glibc
@preconcurrency import Glibc
#elseif canImport(CRT)
import CRT
#elseif canImport(Android)
Expand Down
4 changes: 2 additions & 2 deletions Sources/Foundation/NSLock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions Sources/Foundation/NSSwiftRuntime.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions Sources/Foundation/NSURL.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions Sources/Foundation/Port.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions Sources/Foundation/Thread.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions Sources/Testing/Testing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions Sources/plutil/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1edd7a0

Please sign in to comment.