diff --git a/Sources/LanguageServerProtocolJSONRPC/DisableSigpipe.swift b/Sources/LanguageServerProtocolJSONRPC/DisableSigpipe.swift index 1f1e59195..6d8267a86 100644 --- a/Sources/LanguageServerProtocolJSONRPC/DisableSigpipe.swift +++ b/Sources/LanguageServerProtocolJSONRPC/DisableSigpipe.swift @@ -13,13 +13,15 @@ #if canImport(Glibc) import Glibc +#elseif canImport(Musl) +import Musl #endif -#if os(Linux) || os(Android) +#if canImport(Glibc) || canImport(Musl) // This is a lazily initialised global variable that when read for the first time, will ignore SIGPIPE. private let globallyIgnoredSIGPIPE: Bool = { /* no F_SETNOSIGPIPE on Linux :( */ - _ = Glibc.signal(SIGPIPE, SIG_IGN) + _ = signal(SIGPIPE, SIG_IGN) return true }() diff --git a/Sources/SKSupport/dlopen.swift b/Sources/SKSupport/dlopen.swift index 1fb7cb2c5..d8841ef66 100644 --- a/Sources/SKSupport/dlopen.swift +++ b/Sources/SKSupport/dlopen.swift @@ -15,8 +15,10 @@ import CRT import WinSDK #elseif os(iOS) || os(macOS) || os(tvOS) || os(watchOS) import Darwin -#else +#elseif canImport(Glibc) import Glibc +#elseif canImport(Musl) +import Musl #endif public final class DLHandle { diff --git a/Sources/SourceKitD/SKDRequestArray.swift b/Sources/SourceKitD/SKDRequestArray.swift index d2f2192af..d7c8bbb37 100644 --- a/Sources/SourceKitD/SKDRequestArray.swift +++ b/Sources/SourceKitD/SKDRequestArray.swift @@ -13,6 +13,8 @@ import Csourcekitd #if canImport(Glibc) import Glibc +#elseif canImport(Musl) +import Musl #elseif canImport(CRT) import CRT #endif diff --git a/Sources/SourceKitD/SKDRequestDictionary.swift b/Sources/SourceKitD/SKDRequestDictionary.swift index d188b52b7..9505a2c6a 100644 --- a/Sources/SourceKitD/SKDRequestDictionary.swift +++ b/Sources/SourceKitD/SKDRequestDictionary.swift @@ -13,6 +13,8 @@ import Csourcekitd #if canImport(Glibc) import Glibc +#elseif canImport(Musl) +import Musl #elseif canImport(CRT) import CRT #endif diff --git a/Sources/SourceKitD/SKDResponse.swift b/Sources/SourceKitD/SKDResponse.swift index 7e693f185..aac2af3c1 100644 --- a/Sources/SourceKitD/SKDResponse.swift +++ b/Sources/SourceKitD/SKDResponse.swift @@ -13,6 +13,8 @@ import Csourcekitd #if canImport(Glibc) import Glibc +#elseif canImport(Musl) +import Musl #elseif canImport(CRT) import CRT #endif diff --git a/Sources/SourceKitD/SKDResponseArray.swift b/Sources/SourceKitD/SKDResponseArray.swift index ff55244df..6b6076d0e 100644 --- a/Sources/SourceKitD/SKDResponseArray.swift +++ b/Sources/SourceKitD/SKDResponseArray.swift @@ -13,6 +13,8 @@ import Csourcekitd #if canImport(Glibc) import Glibc +#elseif canImport(Musl) +import Musl #elseif canImport(CRT) import CRT #endif diff --git a/Sources/SourceKitD/SKDResponseDictionary.swift b/Sources/SourceKitD/SKDResponseDictionary.swift index 3025d54e4..55b0117b5 100644 --- a/Sources/SourceKitD/SKDResponseDictionary.swift +++ b/Sources/SourceKitD/SKDResponseDictionary.swift @@ -13,6 +13,8 @@ import Csourcekitd #if canImport(Glibc) import Glibc +#elseif canImport(Musl) +import Musl #elseif canImport(CRT) import CRT #endif