Skip to content

Commit dac5f35

Browse files
authored
Fix build when using static Linux SDK (#80)
This fixes a build issue when using the static Linux SDK. We were branching on `#if os(Linux)` to decide whether a value we are using is an enum or a statically defined integer: Glibc declares it as an enum, whereas Darwin and Musl define it as an integer. We should make sure we are importing Glibc and not Musl when we consider it an enum, as otherwise the build will fail.
1 parent 803769e commit dac5f35

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/GRPCNIOTransportCore/Client/Resolver/DNSResolver.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ package enum DNSResolver {
6161
}
6262

6363
var hints = addrinfo()
64-
#if os(Linux)
64+
#if os(Linux) && canImport(Glibc)
6565
hints.ai_socktype = CInt(SOCK_STREAM.rawValue)
6666
#else
6767
hints.ai_socktype = SOCK_STREAM

0 commit comments

Comments
 (0)