authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-04-22 21:47:25-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-04-22 21:47:25-04:00
log75328e32045d1275c03f1f37058ee0a3b775c632
tree786ecef4dad2079fd29a0deb4ba4fc42c216e0d3
parent25dff91fa099489858428a7071b8c76acf1f943d

exit(1) instead of abort() for file not found


3 files changed, 8 insertions(+), 7 deletions(-)

src/analyze.cpp+4-2
......@@ -4306,7 +4306,8 @@ bool handle_is_ptr(TypeTableEntry *type_entry) {
43064306static ZigWindowsSDK *get_windows_sdk(CodeGen *g) {
43074307 if (g->win_sdk == nullptr) {
43084308 if (os_find_windows_sdk(&g->win_sdk)) {
4309 zig_panic("Unable to determine Windows SDK path.");
4309 fprintf(stderr, "unable to determine windows sdk path\n");
4310 exit(1);
43104311 }
43114312 }
43124313 assert(g->win_sdk != nullptr);
......@@ -4408,7 +4409,8 @@ void find_libc_include_path(CodeGen *g) {
44084409 ZigWindowsSDK *sdk = get_windows_sdk(g);
44094410 g->libc_include_dir = buf_alloc();
44104411 if (os_get_win32_ucrt_include_path(sdk, g->libc_include_dir)) {
4411 zig_panic("Unable to determine libc include path.");
4412 fprintf(stderr, "Unable to determine libc include path. --libc-include-dir");
4413 exit(1);
44124414 }
44134415 } else if (g->zig_target.os == OsLinux) {
44144416 g->libc_include_dir = get_linux_libc_include_path();
src/codegen.cpp+4-2
......@@ -6638,12 +6638,14 @@ static void gen_root_source(CodeGen *g) {
66386638 Buf *abs_full_path = buf_alloc();
66396639 int err;
66406640 if ((err = os_path_real(rel_full_path, abs_full_path))) {
6641 zig_panic("unable to open '%s': %s", buf_ptr(rel_full_path), err_str(err));
6641 fprintf(stderr, "unable to open '%s': %s", buf_ptr(rel_full_path), err_str(err));
6642 exit(1);
66426643 }
66436644
66446645 Buf *source_code = buf_alloc();
66456646 if ((err = os_fetch_file_path(rel_full_path, source_code, true))) {
6646 zig_panic("unable to open '%s': %s", buf_ptr(rel_full_path), err_str(err));
6647 fprintf(stderr, "unable to open '%s': %s", buf_ptr(rel_full_path), err_str(err));
6648 exit(1);
66476649 }
66486650
66496651 g->root_import = add_source_file(g, g->root_package, abs_full_path, source_code);
src/os.cpp-3
......@@ -1334,9 +1334,6 @@ 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 }
13401337 buf_resize(output_buf, 0);
13411338 buf_appendf(output_buf, "%s\\Lib\\%s\\ucrt\\", buf_ptr(&sdk->path10), buf_ptr(&sdk->version10));
13421339 switch (platform_type) {