diff options
| author | Jakub Konka <kubkon@jakubkonka.com> | 2022-09-03 20:59:58 +0200 |
|---|---|---|
| committer | Jakub Konka <kubkon@jakubkonka.com> | 2022-09-07 22:42:57 +0200 |
| commit | 423f424c278f8ba41e36096a1603403eb33c6284 (patch) | |
| tree | b394fca7be45381baa1aeeb853336d387978f880 | |
| parent | e0167ae0e3f0e6c6a667b372b21c322d47ccd92d (diff) | |
| download | zig-423f424c278f8ba41e36096a1603403eb33c6284.tar.gz zig-423f424c278f8ba41e36096a1603403eb33c6284.zip | |
libstd: use windows.GetStdHandle() with stage2_x86_64 backend for now
| -rw-r--r-- | lib/std/io.zig | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/std/io.zig b/lib/std/io.zig index 50d134b856..d878afd3ae 100644 --- a/lib/std/io.zig +++ b/lib/std/io.zig @@ -36,6 +36,10 @@ pub const default_mode: ModeOverride = if (is_async) Mode.evented else .blocking fn getStdOutHandle() os.fd_t { if (builtin.os.tag == .windows) { + if (builtin.zig_backend == .stage2_x86_64) { + // TODO: this is just a temporary workaround until we advance x86 backend further along. + return os.windows.GetStdHandle(os.windows.STD_OUTPUT_HANDLE) catch os.windows.INVALID_HANDLE_VALUE; + } return os.windows.peb().ProcessParameters.hStdOutput; } @@ -58,6 +62,10 @@ pub fn getStdOut() File { fn getStdErrHandle() os.fd_t { if (builtin.os.tag == .windows) { + if (builtin.zig_backend == .stage2_x86_64) { + // TODO: this is just a temporary workaround until we advance x86 backend further along. + return os.windows.GetStdHandle(os.windows.STD_ERROR_HANDLE) catch os.windows.INVALID_HANDLE_VALUE; + } return os.windows.peb().ProcessParameters.hStdError; } @@ -80,6 +88,10 @@ pub fn getStdErr() File { fn getStdInHandle() os.fd_t { if (builtin.os.tag == .windows) { + if (builtin.zig_backend == .stage2_x86_64) { + // TODO: this is just a temporary workaround until we advance x86 backend further along. + return os.windows.GetStdHandle(os.windows.STD_INPUT_HANDLE) catch os.windows.INVALID_HANDLE_VALUE; + } return os.windows.peb().ProcessParameters.hStdInput; } |
