Enable building with the Swift Linux SDK (#151)
This commit is contained in:
parent
e76d61155b
commit
e019cb6909
1 changed files with 25 additions and 2 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue