Skip to content

Commit 3cde639

Browse files
committed
Bump macOS version requirement, mark Windows unsupported
1 parent eaff0f1 commit 3cde639

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ let DarwinPlatforms: [Platform]
1313

1414
let package = Package(
1515
name: "WasmKit",
16-
platforms: [.macOS(.v10_13), .iOS(.v12)],
16+
platforms: [.macOS(.v13), .iOS(.v16)],
1717
products: [
1818
.executable(name: "wasmkit-cli", targets: ["CLI"]),
1919
.library(name: "WasmKit", targets: ["WasmKit"]),

Sources/WASI/Poll.swift

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,25 @@ func poll(
2626
subscriptions: some Sequence<WASIAbi.Subscription>,
2727
_ fdTable: FdTable
2828
) throws {
29-
var pollfds = [pollfd]()
30-
var timeoutMilliseconds = UInt.max
29+
#if os(Windows)
30+
throw WASIAbi.Errno.ENOTSUP
31+
#else
32+
var pollfds = [pollfd]()
33+
var timeoutMilliseconds = UInt.max
3134

32-
for subscription in subscriptions {
33-
let union = subscription.union
34-
switch union {
35-
case .clock(let clock):
36-
timeoutMilliseconds = min(timeoutMilliseconds, .init(clock.timeout / 1_000_000))
37-
case .fdRead(let fd):
38-
pollfds.append(.init(fd: try fdTable.fileDescriptor(fd: fd).rawValue, events: .init(POLLIN), revents: 0))
39-
case .fdWrite(let fd):
40-
pollfds.append(.init(fd: try fdTable.fileDescriptor(fd: fd).rawValue, events: .init(POLLOUT), revents: 0))
35+
for subscription in subscriptions {
36+
let union = subscription.union
37+
switch union {
38+
case .clock(let clock):
39+
timeoutMilliseconds = min(timeoutMilliseconds, .init(clock.timeout / 1_000_000))
40+
case .fdRead(let fd):
41+
pollfds.append(.init(fd: try fdTable.fileDescriptor(fd: fd).rawValue, events: .init(POLLIN), revents: 0))
42+
case .fdWrite(let fd):
43+
pollfds.append(.init(fd: try fdTable.fileDescriptor(fd: fd).rawValue, events: .init(POLLOUT), revents: 0))
4144

45+
}
4246
}
43-
}
4447

45-
poll(&pollfds, .init(pollfds.count), .init(timeoutMilliseconds))
48+
poll(&pollfds, .init(pollfds.count), .init(timeoutMilliseconds))
49+
#endif
4650
}

0 commit comments

Comments
 (0)