Skip to content

Commit 71ddcca

Browse files
committed
Support Musl C standard library
1 parent 25a2348 commit 71ddcca

File tree

4 files changed

+31
-10
lines changed

4 files changed

+31
-10
lines changed

Diff for: CHANGELOG.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@
66

77
#### Enhancements
88

9+
* Support compilation with Musl C standard library.
10+
[SimplyDanny](https://github.com/SimplyDanny)
11+
912
* Build without warnings with Swift 6 compiler.
1013
[SimplyDanny](https://github.com/SimplyDanny)
1114

1215
* Generate docs cleanly with Swift 6 compiler.
1316
[John Fairhurst](https://github.com/johnfairh)
14-
[#821]((https://github.com/realm/SourceKitten/issues/821)
17+
[#821](https://github.com/realm/SourceKitten/issues/821)
1518

1619
* Added new syntax, attribute and declaration kinds introduced in Swift 6.0.
1720
[SimplyDanny](https://github.com/SimplyDanny)

Diff for: Source/SourceKittenFramework/SourceKitObject.swift

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11
import Foundation
2+
23
#if SWIFT_PACKAGE
34
import SourceKit
45
#endif
56

6-
#if os(Linux)
7+
#if os(macOS)
8+
import Darwin
9+
#elseif os(Linux)
10+
#if canImport(Glibc)
711
import Glibc
12+
#elseif canImport(Musl)
13+
import Musl
14+
#endif
815
#elseif os(Windows)
916
import ucrt
1017
#else
11-
import Darwin
18+
#error("Unsupported platform")
1219
#endif
1320

1421
// MARK: - SourceKitObjectConvertible
@@ -86,7 +93,7 @@ public final class SourceKitObject {
8693
///
8794
/// - Parameters:
8895
/// - value: The new value to add to the dictionary.
89-
/// - key: The key to associate with value. If key already exists in the dictionary,
96+
/// - key: The key to associate with value. If key already exists in the dictionary,
9097
/// value replaces the existing associated value. If key isn't already a key of the dictionary
9198
public func updateValue(_ value: SourceKitObjectConvertible, forKey key: UID) {
9299
precondition(value.sourceKitObject != nil)

Diff for: Source/SourceKittenFramework/SwiftDocs.swift

+9-3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,18 @@ import Foundation
44
import SourceKit
55
#endif
66

7-
#if os(Linux)
7+
#if os(macOS)
8+
import Darwin
9+
#elseif os(Linux)
10+
#if canImport(Glibc)
811
import Glibc
12+
#elseif canImport(Musl)
13+
import Musl
14+
#endif
915
#elseif os(Windows)
10-
import CRT
16+
import ucrt
1117
#else
12-
import Darwin
18+
#error("Unsupported platform")
1319
#endif
1420

1521
/// Represents docs for a Swift file.

Diff for: Source/sourcekitten/main.swift

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
import ArgumentParser
2-
#if canImport(Darwin)
2+
import Dispatch
3+
4+
#if os(macOS)
35
import Darwin
4-
#elseif canImport(Glibc)
6+
#elseif os(Linux)
7+
#if canImport(Glibc)
58
import Glibc
9+
#elseif canImport(Musl)
10+
import Musl
11+
#endif
612
#elseif os(Windows)
713
import ucrt
814
#else
915
#error("Unsupported platform")
1016
#endif
11-
import Dispatch
1217

1318
// `sourcekitd_set_notification_handler()` sets the handler to be executed on main thread queue.
1419
// So, we vacate main thread to `dispatchMain()`.

0 commit comments

Comments
 (0)