Skip to content

Commit 32d7f21

Browse files
committed
std.c: stdio streams for WASI
1 parent d0ab4ec commit 32d7f21

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/std/c.zig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10891,7 +10891,7 @@ pub const FILE = switch (native_os) {
1089110891

1089210892
pub fn stdin() *FILE {
1089310893
return switch (native_os) {
10894-
.linux, .serenity, .haiku => private.stdin,
10894+
.linux, .serenity, .haiku, .wasi => private.stdin,
1089510895
.freebsd, .dragonfly, .macos, .ios, .tvos, .watchos, .visionos => private.__stdinp,
1089610896
.netbsd, .openbsd => &private.__sF[0],
1089710897
.solaris, .illumos => &private.__iob[0],
@@ -10902,7 +10902,7 @@ pub fn stdin() *FILE {
1090210902

1090310903
pub fn stdout() *FILE {
1090410904
return switch (native_os) {
10905-
.linux, .serenity, .haiku => private.stdout,
10905+
.linux, .serenity, .haiku, .wasi => private.stdout,
1090610906
.freebsd, .dragonfly, .macos, .ios, .tvos, .watchos, .visionos => private.__stdoutp,
1090710907
.netbsd, .openbsd => &private.__sF[1],
1090810908
.solaris, .illumos => &private.__iob[1],
@@ -10913,7 +10913,7 @@ pub fn stdout() *FILE {
1091310913

1091410914
pub fn stderr() *FILE {
1091510915
return switch (native_os) {
10916-
.linux, .serenity, .haiku => private.stderr,
10916+
.linux, .serenity, .haiku, .wasi => private.stderr,
1091710917
.freebsd, .dragonfly, .macos, .ios, .tvos, .watchos, .visionos => private.__stderrp,
1091810918
.netbsd, .openbsd => &private.__sF[2],
1091910919
.solaris, .illumos => &private.__iob[2],
@@ -11423,7 +11423,7 @@ const private = struct {
1142311423
extern "c" fn __libc_current_sigrtmin() c_int;
1142411424
extern "c" fn __libc_current_sigrtmax() c_int;
1142511425

11426-
// Linux, Serenity, Haiku
11426+
// Linux, Serenity, Haiku, WASI
1142711427
extern "c" var stdin: *FILE;
1142811428
extern "c" var stdout: *FILE;
1142911429
extern "c" var stderr: *FILE;

0 commit comments

Comments
 (0)