| ... | @@ -25,6 +25,7 @@ | ... | @@ -25,6 +25,7 @@ |
| 25 | | 25 | |
| 26 | #include <windows.h> | 26 | #include <windows.h> |
| 27 | #include <io.h> | 27 | #include <io.h> |
| | 28 | #include <fcntl.h> |
| 28 | | 29 | |
| 29 | typedef SSIZE_T ssize_t; | 30 | typedef SSIZE_T ssize_t; |
| 30 | #else | 31 | #else |
| ... | @@ -59,7 +60,6 @@ static clock_serv_t cclock; | ... | @@ -59,7 +60,6 @@ static clock_serv_t cclock; |
| 59 | // implementation in the zig standard library and then this code all gets | 60 | // implementation in the zig standard library and then this code all gets |
| 60 | // deleted when we self-host. it works for now. | 61 | // deleted when we self-host. it works for now. |
| 61 | | 62 | |
| 62 | | | |
| 63 | #if defined(ZIG_OS_POSIX) | 63 | #if defined(ZIG_OS_POSIX) |
| 64 | static void populate_termination(Termination *term, int status) { | 64 | static void populate_termination(Termination *term, int status) { |
| 65 | if (WIFEXITED(status)) { | 65 | if (WIFEXITED(status)) { |
| ... | @@ -886,6 +886,10 @@ int os_make_dir(Buf *path) { | ... | @@ -886,6 +886,10 @@ int os_make_dir(Buf *path) { |
| 886 | | 886 | |
| 887 | int os_init(void) { | 887 | int os_init(void) { |
| 888 | srand((unsigned)time(NULL)); | 888 | srand((unsigned)time(NULL)); |
| | 889 | #if defined(ZIG_OS_WINDOWS) |
| | 890 | _setmode(fileno(stdout), _O_BINARY); |
| | 891 | _setmode(fileno(stderr), _O_BINARY); |
| | 892 | #endif |
| 889 | #if defined(ZIG_OS_WINDOWS) | 893 | #if defined(ZIG_OS_WINDOWS) |
| 890 | unsigned __int64 frequency; | 894 | unsigned __int64 frequency; |
| 891 | if (QueryPerformanceFrequency((LARGE_INTEGER*) &frequency)) { | 895 | if (QueryPerformanceFrequency((LARGE_INTEGER*) &frequency)) { |