소스 검색

Fix build issues with static Linux SDK (#2206)

This PR fixes some imports so that grpc-swift can be built using the
static Linux SDK.
Gus Cairo 8 달 전
부모
커밋
433c0d1337
2개의 변경된 파일9개의 추가작업 그리고 3개의 파일을 삭제
  1. 5 1
      Sources/GRPCCore/Call/Client/Internal/RetryDelaySequence.swift
  2. 4 2
      Sources/GRPCInProcessTransport/Syscalls.swift

+ 5 - 1
Sources/GRPCCore/Call/Client/Internal/RetryDelaySequence.swift

@@ -15,8 +15,12 @@
  */
 #if canImport(Darwin)
 public import Darwin  // should be @usableFromInline
-#else
+#elseif canImport(Glibc)
 public import Glibc  // should be @usableFromInline
+#elseif canImport(Musl)
+public import Musl  // should be @usableFromInline
+#else
+#error("Unsupported OS")
 #endif
 
 @usableFromInline

+ 4 - 2
Sources/GRPCInProcessTransport/Syscalls.swift

@@ -17,9 +17,11 @@
 #if canImport(Darwin)
 private import Darwin
 #elseif canImport(Glibc)
-private import Glibc
+private import Glibc  // should be @usableFromInline
 #elseif canImport(Musl)
-private import Musl
+private import Musl  // should be @usableFromInline
+#else
+#error("Unsupported OS")
 #endif
 
 enum System {