Skip to content

Commit

Permalink
Explicitly import locale modules (#771)
Browse files Browse the repository at this point in the history
The Darwin module is slowly being split up, and as it gets further
along, it will stop importing some of the split-out modules like the one
for locale.h that provides newlocale() and other locale API. However,
there's a wrinkle that on platforms with xlocale, it's xlocale.h that
provides most of the POSIX locale.h functions and not locale.h, so
prefer the xlocale module when available.
  • Loading branch information
ian-twilightcoder authored Sep 14, 2024
1 parent 1120541 commit 6df8e1c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Sources/AsyncHTTPClient/HTTPClient+HTTPCookie.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
//===----------------------------------------------------------------------===//

import NIOHTTP1
#if canImport(Darwin)
#if canImport(xlocale)
import xlocale
#elseif canImport(locale_h)
import locale_h
#elseif canImport(Darwin)
import Darwin
#elseif canImport(Musl)
import Musl
Expand Down
6 changes: 5 additions & 1 deletion Tests/AsyncHTTPClientTests/HTTPClientTestUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ import NIOSSL
import NIOTLS
import NIOTransportServices
import XCTest
#if canImport(Darwin)
#if canImport(xlocale)
import xlocale
#elseif canImport(locale_h)
import locale_h
#elseif canImport(Darwin)
import Darwin
#elseif canImport(Musl)
import Musl
Expand Down

0 comments on commit 6df8e1c

Please sign in to comment.