Skip to content

Commit f5e866a

Browse files
committed
std.c: stdio streams for Windows
1 parent 0a98a21 commit f5e866a

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
@@ -10858,6 +10858,7 @@ pub fn stdin() *FILE {
1085810858
.freebsd, .dragonfly, .macos, .ios, .tvos, .watchos, .visionos => private.__stdinp,
1085910859
.netbsd, .openbsd => &private.__sF[0],
1086010860
.solaris, .illumos => &private.__iob[0],
10861+
.windows => private.__acrt_iob_func(0),
1086110862
else => @compileError("stdio streams unsupported on this platform"),
1086210863
};
1086310864
}
@@ -10868,6 +10869,7 @@ pub fn stdout() *FILE {
1086810869
.freebsd, .dragonfly, .macos, .ios, .tvos, .watchos, .visionos => private.__stdoutp,
1086910870
.netbsd, .openbsd => &private.__sF[1],
1087010871
.solaris, .illumos => &private.__iob[1],
10872+
.windows => private.__acrt_iob_func(1),
1087110873
else => @compileError("stdio streams unsupported on this platform"),
1087210874
};
1087310875
}
@@ -10878,6 +10880,7 @@ pub fn stderr() *FILE {
1087810880
.freebsd, .dragonfly, .macos, .ios, .tvos, .watchos, .visionos => private.__stderrp,
1087910881
.netbsd, .openbsd => &private.__sF[2],
1088010882
.solaris, .illumos => &private.__iob[2],
10883+
.windows => private.__acrt_iob_func(2),
1088110884
else => @compileError("stdio streams unsupported on this platform"),
1088210885
};
1088310886
}
@@ -11405,6 +11408,9 @@ const private = struct {
1140511408
else => void,
1140611409
};
1140711410

11411+
// Windows stdio streams
11412+
extern "c" fn __acrt_iob_func(index: c_uint) *FILE;
11413+
1140811414
// Don't forget to add another clown when an OS picks yet another unique
1140911415
// symbol name for errno location!
1141011416
// 🤡🤡🤡🤡🤡🤡

0 commit comments

Comments
 (0)