Enable building with the Swift Linux SDK (#151)

This commit is contained in:
Tobias 2025-08-14 13:30:58 +02:00 • committed by GitHub
commit e019cb6909
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -13,9 +13,11 @@ import struct Foundation.Data
import Darwin.POSIX
#elseif canImport(Glibc)
import Glibc
#elseif canImport(Musl)
import Musl
#endif
#if canImport(Darwin) || canImport(Glibc)
#if canImport(Darwin) || canImport(Glibc) || canImport(Musl)
/// An implementation of the MCP stdio transport protocol.
///
/// This transport implements the [stdio transport](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#stdio)
@ -107,7 +109,7 @@ import struct Foundation.Data
/// - Parameter fileDescriptor: The file descriptor to configure
/// - Throws: Error if the operation fails
private func setNonBlocking(fileDescriptor: FileDescriptor) throws {
#if canImport(Darwin) || canImport(Glibc)
#if canImport(Darwin) || canImport(Glibc) || canImport(Musl)
// Get current flags
let flags = fcntl(fileDescriptor.rawValue, F_GETFL)
guard flags >= 0 else {