diff --git a/Sources/Path+FileManager.swift b/Sources/Path+FileManager.swift index 3798187..34e6473 100644 --- a/Sources/Path+FileManager.swift +++ b/Sources/Path+FileManager.swift @@ -1,6 +1,8 @@ import Foundation -#if os(Linux) +#if canImport(Glibc) import Glibc +#elseif canImport(Musl) +import Musl #endif public extension Pathish { diff --git a/Sources/Path.swift b/Sources/Path.swift index 5252faa..226e0b7 100644 --- a/Sources/Path.swift +++ b/Sources/Path.swift @@ -1,10 +1,13 @@ import Foundation -#if !os(Linux) +#if canImport(Darwin) import func Darwin.realpath let _realpath = Darwin.realpath -#else +#elseif canImport(Glibc) import func Glibc.realpath let _realpath = Glibc.realpath +#elseif canImport(Musl) +import func Musl.realpath +let _realpath = Musl.realpath #endif public typealias PathStruct = Path diff --git a/Sources/PathToBool.swift b/Sources/PathToBool.swift index 31270bd..577cbd6 100644 --- a/Sources/PathToBool.swift +++ b/Sources/PathToBool.swift @@ -1,8 +1,10 @@ import Foundation -#if os(Linux) -import func Glibc.access -#else +#if canImport(Darwin) import Darwin +#elseif canImport(Glibc) +import func Glibc.access +#elseif canImport(Musl) +import func Musl.access #endif public extension Pathish {