mirror of
https://github.com/ziglang/zig.git
synced 2026-01-03 20:13:21 +00:00
translate-c: fix not printing clang errors
This commit is contained in:
parent
5ebed1c9ee
commit
74cea89fce
@ -5298,18 +5298,19 @@ void codegen_translate_c(CodeGen *g, Buf *full_path) {
|
||||
|
||||
ZigList<ErrorMsg *> errors = {0};
|
||||
int err = parse_h_file(import, &errors, buf_ptr(full_path), g, nullptr);
|
||||
if (err) {
|
||||
fprintf(stderr, "unable to parse C file: %s\n", err_str(err));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (errors.length > 0) {
|
||||
if (err == ErrorCCompileErrors && errors.length > 0) {
|
||||
for (size_t i = 0; i < errors.length; i += 1) {
|
||||
ErrorMsg *err_msg = errors.at(i);
|
||||
print_err_msg(err_msg, g->err_color);
|
||||
}
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (err) {
|
||||
fprintf(stderr, "unable to parse C file: %s\n", err_str(err));
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
static ImportTableEntry *add_special_code(CodeGen *g, PackageTableEntry *package, const char *basename) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user