Skip to content

Commit 1470451

Browse files
authored
Fix Android build (#2207)
This PR follows-up #2206 and fixes the Android build I noticed at https://swift-everywhere.org. Hopefully we will soon have CI support for Android (swiftlang/github-workflows#106) to catch this sort of breakage sooner.
1 parent 634ab22 commit 1470451

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Sources/GRPCCore/Call/Client/Internal/RetryDelaySequence.swift

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
*/
1616
#if canImport(Darwin)
1717
public import Darwin // should be @usableFromInline
18+
#elseif canImport(Android)
19+
public import Android // should be @usableFromInline
1820
#elseif canImport(Glibc)
1921
public import Glibc // should be @usableFromInline
2022
#elseif canImport(Musl)

Sources/GRPCInProcessTransport/Syscalls.swift

+5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
#if canImport(Darwin)
1818
private import Darwin
19+
#elseif canImport(Android)
20+
private import Android // should be @usableFromInline
1921
#elseif canImport(Glibc)
2022
private import Glibc // should be @usableFromInline
2123
#elseif canImport(Musl)
@@ -29,6 +31,9 @@ enum System {
2931
#if canImport(Darwin)
3032
let pid = Darwin.getpid()
3133
return Int(pid)
34+
#elseif canImport(Android)
35+
let pid = Android.getpid()
36+
return Int(pid)
3237
#elseif canImport(Glibc)
3338
let pid = Glibc.getpid()
3439
return Int(pid)

0 commit comments

Comments
 (0)