Skip to content

Commit d0ab4ec

Browse files
committed
std.c: stdio streams for Windows
1 parent 69123df commit d0ab4ec

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/std/c.zig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10895,6 +10895,7 @@ pub fn stdin() *FILE {
1089510895
.freebsd, .dragonfly, .macos, .ios, .tvos, .watchos, .visionos => private.__stdinp,
1089610896
.netbsd, .openbsd => &private.__sF[0],
1089710897
.solaris, .illumos => &private.__iob[0],
10898+
.windows => private.__acrt_iob_func(0),
1089810899
else => @compileError("stdio streams unsupported on this platform"),
1089910900
};
1090010901
}
@@ -10905,6 +10906,7 @@ pub fn stdout() *FILE {
1090510906
.freebsd, .dragonfly, .macos, .ios, .tvos, .watchos, .visionos => private.__stdoutp,
1090610907
.netbsd, .openbsd => &private.__sF[1],
1090710908
.solaris, .illumos => &private.__iob[1],
10909+
.windows => private.__acrt_iob_func(1),
1090810910
else => @compileError("stdio streams unsupported on this platform"),
1090910911
};
1091010912
}
@@ -10915,6 +10917,7 @@ pub fn stderr() *FILE {
1091510917
.freebsd, .dragonfly, .macos, .ios, .tvos, .watchos, .visionos => private.__stderrp,
1091610918
.netbsd, .openbsd => &private.__sF[2],
1091710919
.solaris, .illumos => &private.__iob[2],
10920+
.windows => private.__acrt_iob_func(2),
1091810921
else => @compileError("stdio streams unsupported on this platform"),
1091910922
};
1092010923
}
@@ -11442,6 +11445,9 @@ const private = struct {
1144211445
else => void,
1144311446
};
1144411447

11448+
// Windows stdio streams
11449+
extern "c" fn __acrt_iob_func(index: c_uint) *FILE;
11450+
1144511451
// Don't forget to add another clown when an OS picks yet another unique
1144611452
// symbol name for errno location!
1144711453
// 🤡🤡🤡🤡🤡🤡

0 commit comments

Comments
 (0)