From f580c7fa4330a0c181226060d2e778285fa38dc0 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 15 Feb 2016 16:52:37 -0700 Subject: handle libc include path and libc lib path differently --- src/analyze.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/analyze.cpp') 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(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) { -- cgit v1.2.3