Skip to content

support URLSession concurrency method in Swift 6(Linux, Windows) #58

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 7 commits into from
Jul 17, 2024
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
.xcode
/*.xcodeproj
.xcode
DerivedData

.swiftpm/
Package.resolved
Expand Down
4 changes: 3 additions & 1 deletion Sources/HTTPTypesFoundation/URLSession+HTTPTypes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private enum HTTPTypeConversionError: Error {

#endif

#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(visionOS)
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(visionOS) || compiler(>=6)

@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
extension URLSession {
Expand Down Expand Up @@ -114,6 +114,7 @@ extension URLSession {
return (location, response)
}

#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(visionOS)
/// Returns a byte stream that conforms to AsyncSequence protocol.
///
/// - Parameter request: The `HTTPRequest` for which to load data.
Expand All @@ -129,6 +130,7 @@ extension URLSession {
}
return (data, response)
}
#endif
}

@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
Expand Down