authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-01-19 22:17:31-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-01-19 22:17:31-05:00
logddd04a7b46f897314c8c1c540c998f90fea64ba2
tree145b924eec4835c5ceda75219e407fd1a28ab5b8
parentec27d3b4ba70984793f16e54533147914adcc3ab

fix docgen on windows


2 files changed, 9 insertions(+), 7 deletions(-)

doc/langref.html.in+8-4
...@@ -2099,10 +2099,10 @@ const os_msg = switch (builtin.os) {...@@ -2099,10 +2099,10 @@ const os_msg = switch (builtin.os) {
2099// evaluated if the target expression is compile-time known.2099// evaluated if the target expression is compile-time known.
2100test "switch inside function" {2100test "switch inside function" {
2101 switch (builtin.os) {2101 switch (builtin.os) {
2102 builtin.Os.windows => {2102 builtin.Os.fuchsia => {
2103 // On an OS other than windows, block is not even analyzed,2103 // On an OS other than fuchsia, block is not even analyzed,
2104 // so this compile error is not triggered.2104 // so this compile error is not triggered.
2105 // On windows this compile error would be triggered.2105 // On fuchsia this compile error would be triggered.
2106 @compileError("windows not supported");2106 @compileError("windows not supported");
2107 },2107 },
2108 else => {},2108 else => {},
...@@ -5172,7 +5172,11 @@ pub fn main() {...@@ -5172,7 +5172,11 @@ pub fn main() {
5172 </p>5172 </p>
5173 {#code_begin|exe#}5173 {#code_begin|exe#}
5174 {#link_libc#}5174 {#link_libc#}
5175const c = @cImport(@cInclude("stdio.h"));5175const c = @cImport({
5176 // See https://github.com/zig-lang/zig/issues/515
5177 @cDefine("_NO_CRT_STDIO_INLINE", "1");
5178 @cInclude("stdio.h");
5179});
5176pub fn main() {5180pub fn main() {
5177 _ = c.printf(c"hello\n");5181 _ = c.printf(c"hello\n");
5178}5182}
src/os.cpp+1-3
...@@ -390,7 +390,6 @@ static int os_exec_process_posix(const char *exe, ZigList<const char *> &args,...@@ -390,7 +390,6 @@ static int os_exec_process_posix(const char *exe, ZigList<const char *> &args,
390390
391#if defined(ZIG_OS_WINDOWS)391#if defined(ZIG_OS_WINDOWS)
392392
393/*
394static void win32_panic(const char *str) {393static void win32_panic(const char *str) {
395 DWORD err = GetLastError();394 DWORD err = GetLastError();
396 LPSTR messageBuffer = nullptr;395 LPSTR messageBuffer = nullptr;
...@@ -400,7 +399,6 @@ static void win32_panic(const char *str) {...@@ -400,7 +399,6 @@ static void win32_panic(const char *str) {
400 zig_panic(str, messageBuffer);399 zig_panic(str, messageBuffer);
401 LocalFree(messageBuffer);400 LocalFree(messageBuffer);
402}401}
403*/
404402
405static int os_exec_process_windows(const char *exe, ZigList<const char *> &args,403static int os_exec_process_windows(const char *exe, ZigList<const char *> &args,
406 Termination *term, Buf *out_stderr, Buf *out_stdout)404 Termination *term, Buf *out_stderr, Buf *out_stdout)
...@@ -798,7 +796,7 @@ int os_rename(Buf *src_path, Buf *dest_path) {...@@ -798,7 +796,7 @@ int os_rename(Buf *src_path, Buf *dest_path) {
798 return 0;796 return 0;
799 }797 }
800#if defined(ZIG_OS_WINDOWS)798#if defined(ZIG_OS_WINDOWS)
801 if (!MoveFileEx(buf_ptr(dest_path), buf_ptr(src_path), MOVEFILE_REPLACE_EXISTING)) {799 if (!MoveFileExA(buf_ptr(src_path), buf_ptr(dest_path), MOVEFILE_REPLACE_EXISTING)) {
802 return ErrorFileSystem;800 return ErrorFileSystem;
803 }801 }
804#else802#else