Skip to content

Android support #799

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Sources/AsyncHTTPClient/ConnectionPool.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ import NIOSSL
import Darwin.C
#elseif canImport(Musl)
import Musl
#elseif os(Linux) || os(FreeBSD) || os(Android)
#elseif canImport(Android)
import Android
#elseif os(Linux) || os(FreeBSD)
import Glibc
#else
#error("unsupported target operating system")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import NIOCore
import func Darwin.pow
#elseif canImport(Musl)
import func Musl.pow
#elseif canImport(Android)
import func Android.pow
#else
import func Glibc.pow
#endif
Expand Down
2 changes: 2 additions & 0 deletions Sources/AsyncHTTPClient/HTTPClient+HTTPCookie.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import locale_h
import Darwin
#elseif canImport(Musl)
import Musl
#elseif canImport(Android)
import Android
#elseif canImport(Glibc)
import Glibc
#endif
Expand Down
2 changes: 1 addition & 1 deletion Sources/CAsyncHTTPClient/CAsyncHTTPClient.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ bool swiftahc_cshims_strptime(const char * string, const char * format, struct t

bool swiftahc_cshims_strptime_l(const char * string, const char * format, struct tm * result, void * locale) {
// The pointer cast is fine as long we make sure it really points to a locale_t.
#ifdef __musl__
#if defined(__musl__) || defined(__ANDROID__)
const char * firstNonProcessed = strptime(string, format, result);
#else
const char * firstNonProcessed = strptime_l(string, format, result, (locale_t)locale);
Expand Down
2 changes: 2 additions & 0 deletions Tests/AsyncHTTPClientTests/HTTPClientTestUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ import locale_h
import Darwin
#elseif canImport(Musl)
import Musl
#elseif canImport(Android)
import Android
#elseif canImport(Glibc)
import Glibc
#endif
Expand Down
Loading