Merge pull request #41 from MaxDesiatov/maxd/fix-wasi-builds

Fix package not building for WASI
This commit is contained in:
Guoye Zhang authored and GitHub committed 2024-01-11 20:47:38 -08:00
commit 782b1bf9d1
4 files changed
+15 -1

No files matched your search

+3 -1
View File
@@ -14,8 +14,10 @@
#if canImport(os.lock)
import os.lock
#else
#elseif canImport(Glibc)
import Glibc
#elseif canImport(WASILibc)
import WASILibc
#endif
/// A collection of HTTP fields. It is used in `HTTPRequest` and `HTTPResponse`, and can also be
@@ -18,6 +18,8 @@ import HTTPTypes
import FoundationNetworking
#endif
#if !os(WASI)
extension URLRequest {
/// Create a `URLRequest` from an `HTTPRequest`.
/// - Parameter httpRequest: The HTTP request to convert from.
@@ -63,3 +65,5 @@ extension URLRequest {
return request
}
}
#endif
@@ -18,6 +18,8 @@ import HTTPTypes
import FoundationNetworking
#endif
#if !os(WASI)
extension HTTPURLResponse {
/// Create an `HTTPURLResponse` from an `HTTPResponse`.
/// - Parameter httpResponse: The HTTP response to convert from.
@@ -55,3 +57,5 @@ extension HTTPURLResponse {
return response
}
}
#endif
@@ -18,6 +18,8 @@ import HTTPTypes
import FoundationNetworking
#endif
#if !os(WASI)
extension URLSessionTask {
/// The original HTTP request this task was created with.
public var originalHTTPRequest: HTTPRequest? {
@@ -40,6 +42,8 @@ private enum HTTPTypeConversionError: Error {
case failedToConvertURLResponseToHTTPResponse
}
#endif
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(visionOS)
@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)