From 55e7ae92874024b23c446958ca54361c5c9be736 Mon Sep 17 00:00:00 2001 From: Marc Prud'hommeaux Date: Fri, 14 Mar 2025 11:59:42 -0400 Subject: [PATCH] Fix Android build --- .../GRPCCore/Call/Client/Internal/RetryDelaySequence.swift | 2 ++ Sources/GRPCInProcessTransport/Syscalls.swift | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/Sources/GRPCCore/Call/Client/Internal/RetryDelaySequence.swift b/Sources/GRPCCore/Call/Client/Internal/RetryDelaySequence.swift index 46b3e197d..4f87682b2 100644 --- a/Sources/GRPCCore/Call/Client/Internal/RetryDelaySequence.swift +++ b/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) diff --git a/Sources/GRPCInProcessTransport/Syscalls.swift b/Sources/GRPCInProcessTransport/Syscalls.swift index 538eb3a78..c96becbd5 100644 --- a/Sources/GRPCInProcessTransport/Syscalls.swift +++ b/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)