Skip to content

Commit 32a95f2

Browse files
committed
Check the compiler version instead
1 parent 06a234b commit 32a95f2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Sources/HTTPTypes/HTTPFields.swift

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

15-
#if canImport(Synchronization)
15+
#if compiler(>=6.0)
1616
import Synchronization
17-
#endif // canImport(Synchronization)
17+
#endif // compiler(>=6.0)
1818

1919
/// A collection of HTTP fields. It is used in `HTTPRequest` and `HTTPResponse`, and can also be
2020
/// used as HTTP trailer fields.
@@ -109,7 +109,7 @@ public struct HTTPFields: Sendable, Hashable {
109109
}
110110
}
111111

112-
#if canImport(Synchronization)
112+
#if compiler(>=6.0)
113113
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
114114
private final class _StorageWithMutex: _Storage, @unchecked Sendable {
115115
let mutex = Mutex<Void>(())
@@ -120,7 +120,7 @@ public struct HTTPFields: Sendable, Hashable {
120120
}
121121
}
122122
}
123-
#endif // canImport(Synchronization)
123+
#endif // compiler(>=6.0)
124124

125125
private final class _StorageWithNIOLock: _Storage, @unchecked Sendable {
126126
let lock = LockStorage.create(value: ())
@@ -133,15 +133,15 @@ public struct HTTPFields: Sendable, Hashable {
133133
}
134134

135135
private var _storage = {
136-
#if canImport(Synchronization)
136+
#if compiler(>=6.0)
137137
if #available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) {
138138
_StorageWithMutex()
139139
} else {
140140
_StorageWithNIOLock()
141141
}
142-
#else // canImport(Synchronization)
142+
#else // compiler(>=6.0)
143143
_StorageWithNIOLock()
144-
#endif // canImport(Synchronization)
144+
#endif // compiler(>=6.0)
145145
}()
146146

147147
/// Create an empty list of HTTP fields

0 commit comments

Comments
 (0)