Skip to content

Commit a5fc305

Browse files
kateinoigakukunrunner
authored andcommitted
[wasm][stdlib] Fix build of SwiftPrivate on WASI
Just support WASILibc as well as other libc modules
1 parent 86ea091 commit a5fc305

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

stdlib/private/SwiftPrivate/IO.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,16 @@ import SwiftShims
1616
#if canImport(Darwin)
1717
import Darwin
1818
let (platform_read, platform_write, platform_close) = (read, write, close)
19-
#elseif canImport(Glibc)
20-
import Glibc
21-
let (platform_read, platform_write, platform_close) = (read, write, close)
2219
#elseif os(Windows)
2320
import CRT
2421
import WinSDK
22+
#else
23+
#if os(WASI)
24+
import WASILibc
25+
#elseif canImport(Glibc)
26+
import Glibc
27+
#endif
28+
let (platform_read, platform_write, platform_close) = (read, write, close)
2529
#endif
2630

2731
#if os(Windows)

0 commit comments

Comments
 (0)