Skip to content

Commit bd771e2

Browse files
committed
Fix 5.9 build
Motivation: An oversight in 373862a meant that 5.9 wasn't actually dropped which means that the use of 'nonisolated(unsafe)' in 0e715a2 broke users of 5.9. Modifications: - Add back a 5.9 path Result: Builds on 5.9
1 parent 3b265e6 commit bd771e2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Sources/AsyncHTTPClient/HTTPClient+HTTPCookie.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,21 @@ extension String.UTF8View.SubSequence {
216216
}
217217
}
218218

219+
#if compiler(>=5.10)
219220
nonisolated(unsafe) private let posixLocale: UnsafeMutableRawPointer = {
220221
// All POSIX systems must provide a "POSIX" locale, and its date/time formats are US English.
221222
// https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_05
222223
let _posixLocale = newlocale(LC_TIME_MASK | LC_NUMERIC_MASK, "POSIX", nil)!
223224
return UnsafeMutableRawPointer(_posixLocale)
224225
}()
226+
#else
227+
private let posixLocale: UnsafeMutableRawPointer = {
228+
// All POSIX systems must provide a "POSIX" locale, and its date/time formats are US English.
229+
// https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_05
230+
let _posixLocale = newlocale(LC_TIME_MASK | LC_NUMERIC_MASK, "POSIX", nil)!
231+
return UnsafeMutableRawPointer(_posixLocale)
232+
}()
233+
#endif
225234

226235
private func parseTimestamp(_ utf8: String.UTF8View.SubSequence, format: String) -> tm? {
227236
var timeComponents = tm()

0 commit comments

Comments
 (0)