From 210d0017c40ee24215ce705fcee342fe34b9dccb Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 29 Nov 2017 23:09:35 -0500 Subject: fix build broken by previous commit now we report a compile error for unusual failures from translate-c --- src/ir.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/ir.cpp') diff --git a/src/ir.cpp b/src/ir.cpp index f1dc1e1b4d..e3f223a595 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -13870,7 +13870,10 @@ static TypeTableEntry *ir_analyze_instruction_c_import(IrAnalyze *ira, IrInstruc int err; if ((err = parse_h_buf(child_import, &errors, &cimport_scope->buf, ira->codegen, node))) { - zig_panic("unable to parse C file: %s\n", err_str(err)); + if (err != ErrorCCompileErrors) { + ir_add_error_node(ira, node, buf_sprintf("C import failed: %s", err_str(err))); + return ira->codegen->builtin_types.entry_invalid; + } } if (errors.length > 0) { -- cgit v1.2.3