fix docgen on windows

This commit is contained in:
Andrew Kelley 2018-01-19 22:17:31 -05:00
parent ec27d3b4ba
commit ddd04a7b46
2 changed files with 9 additions and 7 deletions

View File

@ -2099,10 +2099,10 @@ const os_msg = switch (builtin.os) {
// evaluated if the target expression is compile-time known.
test "switch inside function" {
switch (builtin.os) {
builtin.Os.windows => {
// On an OS other than windows, block is not even analyzed,
builtin.Os.fuchsia => {
// On an OS other than fuchsia, block is not even analyzed,
// so this compile error is not triggered.
// On windows this compile error would be triggered.
// On fuchsia this compile error would be triggered.
@compileError("windows not supported");
},
else => {},
@ -5172,7 +5172,11 @@ pub fn main() {
</p>
{#code_begin|exe#}
{#link_libc#}
const c = @cImport(@cInclude("stdio.h"));
const c = @cImport({
// See https://github.com/zig-lang/zig/issues/515
@cDefine("_NO_CRT_STDIO_INLINE", "1");
@cInclude("stdio.h");
});
pub fn main() {
_ = c.printf(c"hello\n");
}

View File

@ -390,7 +390,6 @@ static int os_exec_process_posix(const char *exe, ZigList<const char *> &args,
#if defined(ZIG_OS_WINDOWS)
/*
static void win32_panic(const char *str) {
DWORD err = GetLastError();
LPSTR messageBuffer = nullptr;
@ -400,7 +399,6 @@ static void win32_panic(const char *str) {
zig_panic(str, messageBuffer);
LocalFree(messageBuffer);
}
*/
static int os_exec_process_windows(const char *exe, ZigList<const char *> &args,
Termination *term, Buf *out_stderr, Buf *out_stdout)
@ -798,7 +796,7 @@ int os_rename(Buf *src_path, Buf *dest_path) {
return 0;
}
#if defined(ZIG_OS_WINDOWS)
if (!MoveFileEx(buf_ptr(dest_path), buf_ptr(src_path), MOVEFILE_REPLACE_EXISTING)) {
if (!MoveFileExA(buf_ptr(src_path), buf_ptr(dest_path), MOVEFILE_REPLACE_EXISTING)) {
return ErrorFileSystem;
}
#else