Skip to content

Commit

Permalink
Support compiling against Musl (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonjbeaumont authored May 8, 2024
1 parent 4733b6e commit 11c756c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@

import AtomicCounter
import Foundation
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
#if canImport(Darwin)
import Darwin
#else
#elseif canImport(Glibc)
import Glibc
#elseif canImport(Musl)
import Musl
#else
#error("Unsupported runtime")
#endif

func waitForThreadsToQuiesce(shouldReachZero: Bool) {
Expand Down
8 changes: 6 additions & 2 deletions Sources/Instrumentation/Locks.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,14 @@
//
//===----------------------------------------------------------------------===//

#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
#if canImport(Darwin)
import Darwin
#else
#elseif canImport(Glibc)
import Glibc
#elseif canImport(Musl)
import Musl
#else
#error("Unsupported runtime")
#endif

/// A threading lock based on `libpthread` instead of `libdispatch`.
Expand Down
8 changes: 6 additions & 2 deletions Sources/Tracing/TracingTime.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@
//
//===----------------------------------------------------------------------===//

#if os(Linux)
#if canImport(Darwin)
import Darwin
#elseif canImport(Glibc)
import Glibc
#elseif canImport(Musl)
import Musl
#else
import Darwin
#error("Unsupported runtime")
#endif

@_exported import Instrumentation
Expand Down

0 comments on commit 11c756c

Please sign in to comment.