Skip to content

Commit cad0ae3

Browse files
committed
Fix Linux build by wrapping Apple-specific reachability code in platform checks
1 parent 188ec65 commit cad0ae3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Sources/SQLClientSwift/SQLClient.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ public actor SQLClient {
277277
/// to fail fast with a clear error instead of waiting for FreeTDS to time out.
278278
/// Not called automatically — integrate tests and CI skip it safely this way.
279279
public func checkReachability(server: String, port: UInt16 = 1433) async throws {
280+
#if os(iOS) || os(macOS) || os(tvOS) || os(visionOS)
280281
try await withCheckedThrowingContinuation { (cont: CheckedContinuation<Void, Error>) in
281282
queue.async {
282283
var readStream: Unmanaged<CFReadStream>?
@@ -313,6 +314,10 @@ public actor SQLClient {
313314
}
314315
}
315316
}
317+
#else
318+
// Reachability check not implemented for this platform.
319+
return
320+
#endif
316321
}
317322

318323
private nonisolated func _connectSync(options: SQLClientConnectionOptions) throws -> (login: TDSHandle, connection: TDSHandle) {

0 commit comments

Comments
 (0)