Skip to content
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: 2 additions & 0 deletions Sources/FoundationEssentials/Data/Data+Base64.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import CRT
import WinSDK
#elseif os(WASI)
import WASILibc
#elseif canImport(stdlib_h)
import stdlib_h
#endif

#if !FOUNDATION_FRAMEWORK
Expand Down
2 changes: 2 additions & 0 deletions Sources/FoundationEssentials/Data/Data.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ internal func malloc_good_size(_ size: Int) -> Int {
import ucrt
#elseif canImport(WASILibc)
@preconcurrency import WASILibc
#elseif canImport(string_h)
import string_h
#endif

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

//===--- DataProtocol -----------------------------------------------------===//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import ucrt
@preconcurrency import WASILibc
#elseif canImport(Bionic)
@preconcurrency import Bionic
#elseif canImport(string_h)
import string_h
#endif

@available(macOS 10.10, iOS 8.0, watchOS 2.0, tvOS 9.0, *)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import ucrt
@preconcurrency import WASILibc
#elseif canImport(Bionic)
@preconcurrency import Bionic
#elseif canImport(stdlib_h)
import stdlib_h
#endif

// Underlying storage representation for medium and large data.
Expand Down
9 changes: 8 additions & 1 deletion Sources/FoundationEssentials/Platform.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
//
//===----------------------------------------------------------------------===//

#if !targetEnvironment(exclaveCore)
internal import _FoundationCShims
#endif

#if canImport(Darwin)
import Darwin
Expand Down Expand Up @@ -38,6 +40,11 @@ fileprivate let _pageSize: Int = Int(getpagesize())
@preconcurrency import Musl
fileprivate let _pageSize: Int = Int(getpagesize())
#elseif canImport(C)
#if canImport(C.unistd)
import C.unistd
#else
import C
#endif
fileprivate let _pageSize: Int = Int(getpagesize())
#endif // canImport(Darwin)

Expand Down Expand Up @@ -305,7 +312,7 @@ extension Platform {
}
return String(decodingCString: $0.baseAddress!, as: UTF16.self)
}
#elseif os(WASI) // WASI does not have uname
#elseif os(WASI) || targetEnvironment(exclaveCore) // WASI does not have uname
return "localhost"
#else
return withUnsafeTemporaryAllocation(of: CChar.self, capacity: Platform.MAX_HOSTNAME_LENGTH + 1) {
Expand Down
Loading