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) {
20992099// evaluated if the target expression is compile-time known.
21002100test "switch inside function" {
21012101 switch (builtin.os) {
2102 builtin.Os.windows => {
2103 // On an OS other than windows, block is not even analyzed,
2102 builtin.Os.fuchsia => {
2103 // On an OS other than fuchsia, block is not even analyzed,
21042104 // 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.
21062106 @compileError("windows not supported");
21072107 },
21082108 else => {},
......@@ -5172,7 +5172,11 @@ pub fn main() {
51725172 </p>
51735173 {#code_begin|exe#}
51745174 {#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});
51765180pub fn main() {
51775181 _ = c.printf(c"hello\n");
51785182}
src/os.cpp+1-3
......@@ -390,7 +390,6 @@ static int os_exec_process_posix(const char *exe, ZigList<const char *> &args,
390390
391391#if defined(ZIG_OS_WINDOWS)
392392
393/*
394393static void win32_panic(const char *str) {
395394 DWORD err = GetLastError();
396395 LPSTR messageBuffer = nullptr;
......@@ -400,7 +399,6 @@ static void win32_panic(const char *str) {
400399 zig_panic(str, messageBuffer);
401400 LocalFree(messageBuffer);
402401}
403*/
404402
405403static int os_exec_process_windows(const char *exe, ZigList<const char *> &args,
406404 Termination *term, Buf *out_stderr, Buf *out_stdout)
......@@ -798,7 +796,7 @@ int os_rename(Buf *src_path, Buf *dest_path) {
798796 return 0;
799797 }
800798#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)) {
802800 return ErrorFileSystem;
803801 }
804802#else