Skip to content

Commit 218d7f2

Browse files
committed
Android support
1 parent 5e098b3 commit 218d7f2

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

Sources/GraphQL/Instrumentation/Instrumentation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public extension Instrumentation {
6262
}
6363

6464
func threadId() -> Int {
65-
#if os(Linux)
65+
#if os(Linux) || os(Android)
6666
return Int(pthread_self())
6767
#else
6868
return Int(pthread_mach_thread_np(pthread_self()))

Sources/GraphQL/Map/AnyCoder.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2699,7 +2699,7 @@ private extension _AnyDecoder {
26992699
func unbox(_ value: Any, as type: Bool.Type) throws -> Bool? {
27002700
guard !(value is NSNull) else { return nil }
27012701

2702-
#if DEPLOYMENT_RUNTIME_SWIFT || os(Linux)
2702+
#if DEPLOYMENT_RUNTIME_SWIFT || os(Linux) || os(Android)
27032703
// Bridging differences require us to split implementations here
27042704
guard let number = __SwiftValue.store(value) as? NSNumber else {
27052705
throw DecodingError._typeMismatch(at: codingPath, expectation: type, reality: value)

Sources/GraphQL/Map/MapCoder.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2707,7 +2707,7 @@ private extension _MapDecoder {
27072707
func unbox(_ value: Any, as type: Bool.Type) throws -> Bool? {
27082708
guard !(value is NSNull) else { return nil }
27092709

2710-
#if DEPLOYMENT_RUNTIME_SWIFT || os(Linux)
2710+
#if DEPLOYMENT_RUNTIME_SWIFT || os(Linux) || os(Android)
27112711
// Bridging differences require us to split implementations here
27122712
guard let number = __SwiftValue.store(value) as? NSNumber else {
27132713
throw DecodingError._typeMismatch(at: codingPath, expectation: type, reality: value)

Tests/GraphQLTests/InstrumentationTests/InstrumentationTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class InstrumentationTests: XCTestCase, Instrumentation {
148148
}
149149

150150
func testInstrumentationCalls() throws {
151-
// #if os(Linux)
151+
// #if os(Linux) || os(Android)
152152
// expectedThreadId = Int(pthread_self())
153153
// #else
154154
// expectedThreadId = Int(pthread_mach_thread_np(pthread_self()))
@@ -172,7 +172,7 @@ class InstrumentationTests: XCTestCase, Instrumentation {
172172

173173
func testDispatchQueueInstrumentationWrapper() throws {
174174
// let dispatchGroup = DispatchGroup()
175-
// #if os(Linux)
175+
// #if os(Linux) || os(Android)
176176
// expectedThreadId = Int(pthread_self())
177177
// #else
178178
// expectedThreadId = Int(pthread_mach_thread_np(pthread_self()))

0 commit comments

Comments
 (0)