Skip to content

Commit a298f84

Browse files
committed
Remove 6.0 compiler checks
1 parent fd0c521 commit a298f84

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

Sources/HTTPTypes/HTTPFields.swift

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
#if compiler(>=6.0)
1615
import Synchronization
17-
#endif // compiler(>=6.0)
1816

1917
/// A collection of HTTP fields. It is used in `HTTPRequest` and `HTTPResponse`, and can also be
2018
/// used as HTTP trailer fields.
@@ -109,7 +107,6 @@ public struct HTTPFields: Sendable, Hashable {
109107
}
110108
}
111109

112-
#if compiler(>=6.0)
113110
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
114111
private final class _StorageWithMutex: _Storage, @unchecked Sendable {
115112
let mutex = Mutex<Void>(())
@@ -120,8 +117,8 @@ public struct HTTPFields: Sendable, Hashable {
120117
}
121118
}
122119
}
123-
#endif // compiler(>=6.0)
124120

121+
#if canImport(Darwin)
125122
private final class _StorageWithNIOLock: _Storage, @unchecked Sendable {
126123
let lock = LockStorage.create(value: ())
127124

@@ -131,17 +128,18 @@ public struct HTTPFields: Sendable, Hashable {
131128
}
132129
}
133130
}
131+
#endif
134132

135133
private var _storage = {
136-
#if compiler(>=6.0)
134+
#if canImport(Darwin)
137135
if #available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) {
138136
_StorageWithMutex()
139137
} else {
140138
_StorageWithNIOLock()
141139
}
142-
#else // compiler(>=6.0)
143-
_StorageWithNIOLock()
144-
#endif // compiler(>=6.0)
140+
#else
141+
_StorageWithMutex()
142+
#endif
145143
}()
146144

147145
/// Create an empty list of HTTP fields

Sources/HTTPTypesFoundation/URLSession+HTTPTypes.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ private enum HTTPTypeConversionError: Error {
4545

4646
#endif
4747

48-
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || compiler(>=6) || (compiler(>=6) && os(visionOS))
49-
5048
@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
5149
extension URLSession {
5250
/// Convenience method to load data using an `HTTPRequest`; creates and resumes a `URLSessionDataTask` internally.
@@ -129,7 +127,7 @@ extension URLSession {
129127
return (location, response)
130128
}
131129

132-
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || (compiler(>=6) && os(visionOS))
130+
#if canImport(Darwin)
133131
/// Returns a byte stream that conforms to AsyncSequence protocol.
134132
///
135133
/// - Parameter request: The `HTTPRequest` for which to load data.
@@ -200,5 +198,3 @@ extension URLSession {
200198
return (data, response)
201199
}
202200
}
203-
204-
#endif

0 commit comments

Comments
 (0)