Skip to content

Commit 16071df

Browse files
committed
Fix the musl build in Port.swift
This fixes how we pick up SOCK_STREAM and IPPROTO_TCP from musl. We weren't before so it was just failing to build.
1 parent 1bd5574 commit 16071df

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Sources/Foundation/Port.swift

+6
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,12 @@ fileprivate let FOUNDATION_SOCK_STREAM = Int32(SOCK_STREAM.rawValue)
113113
fileprivate let FOUNDATION_IPPROTO_TCP = Int32(IPPROTO_TCP)
114114
#endif
115115

116+
#if canImport(Musl)
117+
import Musl
118+
fileprivate let FOUNDATION_SOCK_STREAM = Int32(SOCK_STREAM)
119+
fileprivate let FOUNDATION_IPPROTO_TCP = Int32(IPPROTO_TCP)
120+
#endif
121+
116122
#if canImport(Glibc) && os(Android) || os(OpenBSD)
117123
import Glibc
118124
fileprivate let FOUNDATION_SOCK_STREAM = Int32(SOCK_STREAM)

0 commit comments

Comments
 (0)