Skip to content

Commit ff7f6da

Browse files
authored
Merge pull request #2777 from finagolfin/droid
[Android] Use the new overlay and Bionic module from Swift 6
2 parents 0b324f8 + 031e9ed commit ff7f6da

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

Diff for: Sources/SwiftLibraryPluginProvider/LibraryPluginProvider.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ private import Darwin
2222
private import Glibc
2323
#elseif canImport(Musl)
2424
private import Musl
25+
#elseif canImport(Android)
26+
private import Android
2527
#endif
2628
#else
2729
import SwiftSyntaxMacros
@@ -137,7 +139,7 @@ private func _loadLibrary(_ path: String) throws -> UnsafeMutableRawPointer {
137139
#else
138140
private func _loadLibrary(_ path: String) throws -> UnsafeMutableRawPointer {
139141
guard let dlHandle = dlopen(path, RTLD_LAZY | RTLD_LOCAL) else {
140-
throw LibraryPluginError(message: "loader error: \(String(cString: dlerror()))")
142+
throw LibraryPluginError(message: "loader error: \(String(cString: dlerror()!))")
141143
}
142144
return dlHandle
143145
}

Diff for: Sources/SwiftSyntax/SyntaxText.swift

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
private import Darwin
1616
#elseif canImport(Glibc)
1717
private import Glibc
18+
#elseif canImport(Bionic)
19+
private import Bionic
1820
#elseif canImport(Musl)
1921
private import Musl
2022
#endif
@@ -281,6 +283,8 @@ private func compareMemory(
281283
return Darwin.memcmp(s1, s2, count) == 0
282284
#elseif canImport(Glibc)
283285
return Glibc.memcmp(s1, s2, count) == 0
286+
#elseif canImport(Bionic)
287+
return Bionic.memcmp(s1, s2, count) == 0
284288
#else
285289
return UnsafeBufferPointer(start: s1, count: count)
286290
.elementsEqual(UnsafeBufferPointer(start: s2, count: count))

Diff for: SwiftParserCLI/Sources/swift-parser-cli/TerminalUtils.swift

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
import Glibc
1515
#elseif canImport(Musl)
1616
import Musl
17+
#elseif canImport(Android)
18+
import Android
1719
#elseif os(Windows)
1820
import CRT
1921
#else

Diff for: SwiftSyntaxDevUtils/Sources/swift-syntax-dev-utils/common/ProcessRunner.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class SigIntListener {
2424
/// Registers a `SIGINT` signal handler that forwards `SIGINT` to all
2525
/// subprocesses that are registered in `runningSubprocesses`
2626
static func registerSigIntSubprocessTerminationHandler() {
27-
#if canImport(Darwin) || canImport(Glibc)
27+
#if canImport(Darwin) || canImport(Glibc) || canImport(Bionic)
2828
signal(SIGINT) { _ in
2929
SigIntListener.hasReceivedSigInt = true
3030
for process in SigIntListener.runningSubprocesses {

0 commit comments

Comments
 (0)