| ... | @@ -5298,18 +5298,19 @@ void codegen_translate_c(CodeGen *g, Buf *full_path) { | ... | @@ -5298,18 +5298,19 @@ void codegen_translate_c(CodeGen *g, Buf *full_path) { |
| 5298 | | 5298 | |
| 5299 | ZigList<ErrorMsg *> errors = {0}; | 5299 | ZigList<ErrorMsg *> errors = {0}; |
| 5300 | int err = parse_h_file(import, &errors, buf_ptr(full_path), g, nullptr); | 5300 | int err = parse_h_file(import, &errors, buf_ptr(full_path), g, nullptr); |
| 5301 | if (err) { | | |
| 5302 | fprintf(stderr, "unable to parse C file: %s\n", err_str(err)); | | |
| 5303 | exit(1); | | |
| 5304 | } | | |
| 5305 | | 5301 | |
| 5306 | if (errors.length > 0) { | 5302 | if (err == ErrorCCompileErrors && errors.length > 0) { |
| 5307 | for (size_t i = 0; i < errors.length; i += 1) { | 5303 | for (size_t i = 0; i < errors.length; i += 1) { |
| 5308 | ErrorMsg *err_msg = errors.at(i); | 5304 | ErrorMsg *err_msg = errors.at(i); |
| 5309 | print_err_msg(err_msg, g->err_color); | 5305 | print_err_msg(err_msg, g->err_color); |
| 5310 | } | 5306 | } |
| 5311 | exit(1); | 5307 | exit(1); |
| 5312 | } | 5308 | } |
| | 5309 | |
| | 5310 | if (err) { |
| | 5311 | fprintf(stderr, "unable to parse C file: %s\n", err_str(err)); |
| | 5312 | exit(1); |
| | 5313 | } |
| 5313 | } | 5314 | } |
| 5314 | | 5315 | |
| 5315 | static ImportTableEntry *add_special_code(CodeGen *g, PackageTableEntry *package, const char *basename) { | 5316 | static ImportTableEntry *add_special_code(CodeGen *g, PackageTableEntry *package, const char *basename) { |