Преглед изворни кода

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
(https://github.com/swiftlang/github-workflows/pull/106) to catch this
sort of breakage sooner.
Marc Prud'hommeaux пре 8 месеци
родитељ
комит
147045139d

+ 2 - 0
Sources/GRPCCore/Call/Client/Internal/RetryDelaySequence.swift

@@ -15,6 +15,8 @@
  */
 #if canImport(Darwin)
 public import Darwin  // should be @usableFromInline
+#elseif canImport(Android)
+public import Android  // should be @usableFromInline
 #elseif canImport(Glibc)
 public import Glibc  // should be @usableFromInline
 #elseif canImport(Musl)

+ 5 - 0
Sources/GRPCInProcessTransport/Syscalls.swift

@@ -16,6 +16,8 @@
 
 #if canImport(Darwin)
 private import Darwin
+#elseif canImport(Android)
+private import Android  // should be @usableFromInline
 #elseif canImport(Glibc)
 private import Glibc  // should be @usableFromInline
 #elseif canImport(Musl)
@@ -29,6 +31,9 @@ enum System {
     #if canImport(Darwin)
     let pid = Darwin.getpid()
     return Int(pid)
+    #elseif canImport(Android)
+    let pid = Android.getpid()
+    return Int(pid)
     #elseif canImport(Glibc)
     let pid = Glibc.getpid()
     return Int(pid)