diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-02-15 16:52:37 -0700 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-02-15 16:52:37 -0700 |
| commit | f580c7fa4330a0c181226060d2e778285fa38dc0 (patch) | |
| tree | 5e50ba6c9097b62371cf57b913465ff6e8ebbce2 /src/analyze.cpp | |
| parent | c6bf9c6942a8d348aeb02e6dff843ec382c3f0b9 (diff) | |
| download | zig-f580c7fa4330a0c181226060d2e778285fa38dc0.tar.gz zig-f580c7fa4330a0c181226060d2e778285fa38dc0.zip | |
handle libc include path and libc lib path differently
Diffstat (limited to 'src/analyze.cpp')
| -rw-r--r-- | src/analyze.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp index d2381a9156..eddda4ed18 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -1370,7 +1370,7 @@ static void resolve_c_import_decl(CodeGen *g, ImportTableEntry *parent_import, A return; } - find_libc_path(g); + find_libc_include_path(g); ImportTableEntry *child_import = allocate<ImportTableEntry>(1); child_import->fn_table.init(32); @@ -6107,7 +6107,13 @@ bool handle_is_ptr(TypeTableEntry *type_entry) { zig_unreachable(); } -void find_libc_path(CodeGen *g) { +void find_libc_include_path(CodeGen *g) { + if (!g->libc_include_dir || buf_len(g->libc_include_dir) == 0) { + zig_panic("Unable to determine libc include path."); + } +} + +void find_libc_lib_path(CodeGen *g) { // later we can handle this better by reporting an error via the normal mechanism if (!g->libc_lib_dir || buf_len(g->libc_lib_dir) == 0) { zig_panic("Unable to determine libc lib path."); @@ -6115,9 +6121,6 @@ void find_libc_path(CodeGen *g) { if (!g->libc_static_lib_dir || buf_len(g->libc_static_lib_dir) == 0) { zig_panic("Unable to determine libc static lib path."); } - if (!g->libc_include_dir || buf_len(g->libc_include_dir) == 0) { - zig_panic("Unable to determine libc include path."); - } } static uint32_t hash_ptr(void *ptr) { |
