Skip to content

Commit e7ae58e

Browse files
Enable URLSession additions on other OS's in swift 6 (#181)
With [this PR](swiftlang/swift-corelibs-foundation#4970), the async/await URLSession functions are now available on other OS's, but only in swift 6. Updates `URLSessionAdditions.swift` to also check for swift 6, and enable these urlsession -> afluent bridge functions when possible.
1 parent c9b2a6b commit e7ae58e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Sources/Afluent/Additions/URLSessionAdditions.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) || os(visionOS)
1+
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) || os(visionOS) || swift(>=6.0)
22
//
33
// URLSessionAdditions.swift
44
//
@@ -7,6 +7,9 @@
77
//
88

99
import Foundation
10+
#if canImport(FoundationNetworking)
11+
import FoundationNetworking
12+
#endif
1013

1114
extension URLSession {
1215
/// Returns a deferred data task that wraps a URL session data task for a given URL.

0 commit comments

Comments
 (0)