authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-04-22 20:54:52-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-04-22 20:54:52-04:00
log1c41f1ca6252faaa7750936c67562f1866a48075
tree7627845397b04afdce73cfe824865b76262a0d76
parent371a3ad4bd7b1fda56654f32b89c176a0197651f

better error reporting for missing libc on windows

closes #931

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

src/analyze.cpp+6-3
......@@ -4433,7 +4433,8 @@ void find_libc_lib_path(CodeGen *g) {
44334433 if (g->msvc_lib_dir == nullptr) {
44344434 Buf* vc_lib_dir = buf_alloc();
44354435 if (os_get_win32_vcruntime_path(vc_lib_dir, g->zig_target.arch.arch)) {
4436 zig_panic("Unable to determine vcruntime path.");
4436 fprintf(stderr, "Unable to determine vcruntime path. --msvc-lib-dir");
4437 exit(1);
44374438 }
44384439 g->msvc_lib_dir = vc_lib_dir;
44394440 }
......@@ -4441,7 +4442,8 @@ void find_libc_lib_path(CodeGen *g) {
44414442 if (g->libc_lib_dir == nullptr) {
44424443 Buf* ucrt_lib_path = buf_alloc();
44434444 if (os_get_win32_ucrt_lib_path(sdk, ucrt_lib_path, g->zig_target.arch.arch)) {
4444 zig_panic("Unable to determine ucrt path.");
4445 fprintf(stderr, "Unable to determine ucrt path. --libc-lib-dir");
4446 exit(1);
44454447 }
44464448 g->libc_lib_dir = ucrt_lib_path;
44474449 }
......@@ -4449,7 +4451,8 @@ void find_libc_lib_path(CodeGen *g) {
44494451 if (g->kernel32_lib_dir == nullptr) {
44504452 Buf* kern_lib_path = buf_alloc();
44514453 if (os_get_win32_kern32_path(sdk, kern_lib_path, g->zig_target.arch.arch)) {
4452 zig_panic("Unable to determine kernel32 path.");
4454 fprintf(stderr, "Unable to determine kernel32 path. --kernel32-lib-dir");
4455 exit(1);
44534456 }
44544457 g->kernel32_lib_dir = kern_lib_path;
44554458 }
src/os.cpp+3
......@@ -1334,6 +1334,9 @@ com_done:;
13341334
13351335int os_get_win32_ucrt_lib_path(ZigWindowsSDK *sdk, Buf* output_buf, ZigLLVM_ArchType platform_type) {
13361336#if defined(ZIG_OS_WINDOWS)
1337 if (buf_len(sdk->path10) == 0 || buf_len(sdk->version10) == 0) {
1338 return ErrorFileNotFound;
1339 }
13371340 buf_resize(output_buf, 0);
13381341 buf_appendf(output_buf, "%s\\Lib\\%s\\ucrt\\", buf_ptr(&sdk->path10), buf_ptr(&sdk->version10));
13391342 switch (platform_type) {