Skip to content

always @preconcurrency import Glibc/Musl/Android/Bionic/WASILibc #1175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Benchmarks/Benchmarks/Base64/Base64.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ private func autoreleasepool<T>(_ block: () -> T) -> T { block() }
#endif

#if canImport(Glibc)
import Glibc
@preconcurrency import Glibc
#endif
#if canImport(Darwin)
import Darwin
Expand Down
2 changes: 1 addition & 1 deletion Benchmarks/Benchmarks/DataIO/BenchmarkDataIO.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ private func autoreleasepool<T>(_ block: () -> T) -> T { block() }
#endif

#if canImport(Glibc)
import Glibc
@preconcurrency import Glibc
#endif
#if canImport(Darwin)
import Darwin
Expand Down
8 changes: 4 additions & 4 deletions Sources/FoundationEssentials/Calendar/Calendar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
#if canImport(Darwin)
internal import os
#elseif canImport(Bionic)
import Bionic
@preconcurrency import Bionic
#elseif canImport(Glibc)
import Glibc
@preconcurrency import Glibc
#elseif canImport(Musl)
import Musl
@preconcurrency import Musl
#elseif canImport(CRT)
import CRT
#elseif os(WASI)
import WASILibc
@preconcurrency import WASILibc
#endif

#if FOUNDATION_FRAMEWORK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
#if canImport(os)
internal import os
#elseif canImport(Bionic)
import Bionic
@preconcurrency import Bionic
#elseif canImport(Glibc)
import Glibc
@preconcurrency import Glibc
#elseif canImport(Musl)
import Musl
@preconcurrency import Musl
#elseif canImport(CRT)
import CRT
#elseif os(WASI)
import WASILibc
@preconcurrency import WASILibc
#endif


Expand Down
4 changes: 2 additions & 2 deletions Sources/FoundationEssentials/CodableUtilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
#if canImport(Darwin)
import Darwin
#elseif canImport(Bionic)
import Bionic
@preconcurrency import Bionic
#elseif canImport(Glibc)
import Glibc
@preconcurrency import Glibc
#endif

//===----------------------------------------------------------------------===//
Expand Down
8 changes: 4 additions & 4 deletions Sources/FoundationEssentials/Data/Data+Reading.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ internal import _FoundationCShims
#if canImport(Darwin)
import Darwin
#elseif canImport(Android)
import Android
@preconcurrency import Android
#elseif canImport(Glibc)
import Glibc
@preconcurrency import Glibc
#elseif canImport(Musl)
import Musl
@preconcurrency import Musl
#elseif os(Windows)
import CRT
import WinSDK
#elseif os(WASI)
import WASILibc
@preconcurrency import WASILibc
#endif

func _fgetxattr(_ fd: Int32, _ name: UnsafePointer<CChar>!, _ value: UnsafeMutableRawPointer!, _ size: Int, _ position: UInt32, _ options: Int32) -> Int {
Expand Down
8 changes: 4 additions & 4 deletions Sources/FoundationEssentials/Data/Data+Writing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ internal import _FoundationCShims
#if canImport(Darwin)
import Darwin
#elseif canImport(Android)
import Android
@preconcurrency import Android
import unistd
#elseif canImport(Glibc)
import Glibc
@preconcurrency import Glibc
#elseif canImport(Musl)
import Musl
@preconcurrency import Musl
#elseif os(Windows)
import CRT
import WinSDK
#elseif os(WASI)
import WASILibc
@preconcurrency import WASILibc
#endif

#if !NO_FILESYSTEM
Expand Down
8 changes: 4 additions & 4 deletions Sources/FoundationEssentials/Data/Data.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
@usableFromInline let memcpy = ucrt.memcpy
@usableFromInline let memcmp = ucrt.memcmp
#elseif canImport(Bionic)
import Bionic
@preconcurrency import Bionic
@usableFromInline let calloc = Bionic.calloc
@usableFromInline let malloc = Bionic.malloc
@usableFromInline let free = Bionic.free
Expand Down Expand Up @@ -71,13 +71,13 @@ internal func malloc_good_size(_ size: Int) -> Int {
#endif

#if canImport(Glibc)
import Glibc
@preconcurrency import Glibc
#elseif canImport(Musl)
import Musl
@preconcurrency import Musl
#elseif canImport(ucrt)
import ucrt
#elseif canImport(WASILibc)
import WASILibc
@preconcurrency import WASILibc
#endif

#if os(Windows)
Expand Down
6 changes: 3 additions & 3 deletions Sources/FoundationEssentials/Data/DataProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
#if canImport(Darwin)
import Darwin
#elseif canImport(Glibc)
import Glibc
@preconcurrency import Glibc
#elseif canImport(Musl)
import Musl
@preconcurrency import Musl
#elseif canImport(ucrt)
import ucrt
#elseif canImport(WASILibc)
import WASILibc
@preconcurrency import WASILibc
#endif

//===--- DataProtocol -----------------------------------------------------===//
Expand Down
8 changes: 4 additions & 4 deletions Sources/FoundationEssentials/Date.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
#if canImport(Darwin)
import Darwin
#elseif canImport(Bionic)
import Bionic
@preconcurrency import Bionic
#elseif canImport(Glibc)
import Glibc
@preconcurrency import Glibc
#elseif canImport(Musl)
import Musl
@preconcurrency import Musl
#elseif canImport(WinSDK)
import WinSDK
#elseif os(WASI)
import WASILibc
@preconcurrency import WASILibc
#endif

#if !FOUNDATION_FRAMEWORK
Expand Down
8 changes: 4 additions & 4 deletions Sources/FoundationEssentials/Decimal/Decimal+Math.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
#if canImport(Darwin)
import Darwin
#elseif canImport(Bionic)
import Bionic
@preconcurrency import Bionic
#elseif canImport(Glibc)
import Glibc
@preconcurrency import Glibc
#elseif canImport(Musl)
import Musl
@preconcurrency import Musl
#elseif canImport(CRT)
import CRT
#elseif os(WASI)
import WASILibc
@preconcurrency import WASILibc
#endif

private let powerOfTen: [Decimal.VariableLengthInteger] = [
Expand Down
2 changes: 1 addition & 1 deletion Sources/FoundationEssentials/Decimal/Decimal.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(ucrt)
import ucrt
#endif
Expand Down
8 changes: 4 additions & 4 deletions Sources/FoundationEssentials/Error/CocoaError+FilePath.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ internal import _ForSwiftFoundation
#if canImport(Darwin)
import Darwin
#elseif canImport(Bionic)
import Bionic
@preconcurrency import Bionic
#elseif canImport(Glibc)
import Glibc
@preconcurrency import Glibc
#elseif canImport(Musl)
import Musl
@preconcurrency import Musl
#elseif os(Windows)
import CRT
import WinSDK
#elseif os(WASI)
import WASILibc
@preconcurrency import WASILibc
#endif

// MARK: - Error Creation with CocoaError.Code
Expand Down
2 changes: 1 addition & 1 deletion Sources/FoundationEssentials/Error/ErrorCodes+POSIX.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import CRT
import WinSDK
#elseif os(WASI)
import WASILibc
@preconcurrency import WASILibc
#endif

#if FOUNDATION_FRAMEWORK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
#if canImport(Darwin)
import Darwin
#elseif canImport(Android)
import Android
@preconcurrency import Android
#elseif canImport(Glibc)
import Glibc
@preconcurrency import Glibc
#elseif canImport(Musl)
import Musl
@preconcurrency import Musl
#elseif os(Windows)
import CRT
import WinSDK
#elseif os(WASI)
import WASILibc
@preconcurrency import WASILibc
#endif

#if os(Windows)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ internal import os
#if canImport(Darwin)
import Darwin
#elseif canImport(Android)
import Android
@preconcurrency import Android
import unistd
#elseif canImport(Glibc)
import Glibc
@preconcurrency import Glibc
#elseif canImport(Musl)
import Musl
@preconcurrency import Musl
#elseif os(Windows)
import CRT
import WinSDK
#elseif os(WASI)
import WASILibc
@preconcurrency import WASILibc
#endif

internal import _FoundationCShims
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ internal import DarwinPrivate.sys.content_protection
#if canImport(Darwin)
import Darwin
#elseif canImport(Android)
import Android
@preconcurrency import Android
import posix_filesystem
#elseif canImport(Glibc)
import Glibc
@preconcurrency import Glibc
internal import _FoundationCShims
#elseif canImport(Musl)
import Musl
@preconcurrency import Musl
internal import _FoundationCShims
#elseif os(Windows)
import CRT
import WinSDK
#elseif os(WASI)
internal import _FoundationCShims
import WASILibc
@preconcurrency import WASILibc
#endif

extension Date {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@
#if canImport(Darwin)
import Darwin
#elseif canImport(Android)
import Android
@preconcurrency import Android
import unistd
#elseif canImport(Glibc)
import Glibc
@preconcurrency import Glibc
#elseif canImport(Musl)
import Musl
@preconcurrency import Musl
#elseif os(Windows)
import CRT
import WinSDK
internal import _FoundationCShims
#elseif os(WASI)
import WASILibc
@preconcurrency import WASILibc
#endif

extension _FileManagerImpl {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ internal import QuarantinePrivate
#if canImport(Darwin)
import Darwin
#elseif canImport(Android)
import Android
@preconcurrency import Android
#elseif canImport(Glibc)
import Glibc
@preconcurrency import Glibc
internal import _FoundationCShims
#elseif canImport(Musl)
import Musl
@preconcurrency import Musl
internal import _FoundationCShims
#elseif os(Windows)
import CRT
import WinSDK
#elseif os(WASI)
import WASILibc
@preconcurrency import WASILibc
#endif

#if os(Windows)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ struct _Win32DirectoryContentsSequence: Sequence {
#if canImport(Darwin)
import Darwin
#elseif canImport(Android)
import Android
@preconcurrency import Android
import posix_filesystem.dirent
#elseif canImport(Glibc)
import Glibc
@preconcurrency import Glibc
internal import _FoundationCShims
#elseif canImport(Musl)
import Musl
@preconcurrency import Musl
#elseif os(WASI)
import WASILibc
@preconcurrency import WASILibc
internal import _FoundationCShims
#endif

Expand Down
8 changes: 4 additions & 4 deletions Sources/FoundationEssentials/FileManager/FileOperations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
#if canImport(Darwin)
import Darwin
#elseif canImport(Android)
import Android
@preconcurrency import Android
#elseif canImport(Glibc)
import Glibc
@preconcurrency import Glibc
#elseif canImport(Musl)
import Musl
@preconcurrency import Musl
#elseif os(Windows)
import CRT
import WinSDK
#elseif os(WASI)
import WASILibc
@preconcurrency import WASILibc
#endif

#if FOUNDATION_FRAMEWORK
Expand Down
Loading