Skip to content

Commit a5eacbf

Browse files
authored
Add support for Musl libc (#1832)
Since Musl is sufficiently different from Glibc (see https://wiki.musl-libc.org/functional-differences-from-glibc.html), it requires a different import, which now should be applied to files that have `import Glibc` in them.
1 parent 034dca0 commit a5eacbf

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

Sources/SwiftSyntax/SyntaxText.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
@_implementationOnly import Darwin
1616
#elseif canImport(Glibc)
1717
@_implementationOnly import Glibc
18+
#elseif canImport(Musl)
19+
@_implementationOnly import Musl
1820
#endif
1921
#endif
2022

Sources/swift-parser-cli/TerminalUtils.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
#if canImport(Glibc)
1414
import Glibc
15+
#elseif canImport(Musl)
16+
import Musl
1517
#elseif os(Windows)
1618
import CRT
1719
#else

0 commit comments

Comments
 (0)