diff options
| author | Vexu <git@vexu.eu> | 2019-12-13 18:55:34 +0200 |
|---|---|---|
| committer | Vexu <git@vexu.eu> | 2019-12-13 19:06:32 +0200 |
| commit | 45abfa9e7189e5d87d4d49763399531973c2f899 (patch) | |
| tree | e0e9796f3267e802a3ab15a28a8f0886c22a97a5 /src/codegen.cpp | |
| parent | 41a67126a50e3cfab67c749bfc52ac242694774b (diff) | |
| download | zig-45abfa9e7189e5d87d4d49763399531973c2f899.tar.gz zig-45abfa9e7189e5d87d4d49763399531973c2f899.zip | |
revert removal of translate mode in stage 1
Diffstat (limited to 'src/codegen.cpp')
| -rw-r--r-- | src/codegen.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp index 0ba2c23dbe..3604a1b019 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -9020,6 +9020,10 @@ void codegen_translate_c(CodeGen *g, Buf *full_path, FILE *out_file, bool use_us init(g); + TranslateMode trans_mode = buf_ends_with_str(full_path, ".h") ? + TranslateModeImport : TranslateModeTranslate; + + ZigList<const char *> clang_argv = {0}; add_cc_args(g, clang_argv, nullptr, true); @@ -9045,8 +9049,8 @@ void codegen_translate_c(CodeGen *g, Buf *full_path, FILE *out_file, bool use_us err = stage2_translate_c(&ast, &errors_ptr, &errors_len, &clang_argv.at(0), &clang_argv.last(), resources_path); } else { - err = parse_h_file(g, &root_node, &errors_ptr, &errors_len, &clang_argv.at(0), - &clang_argv.last(), resources_path); + err = parse_h_file(g, &root_node, &errors_ptr, &errors_len, &clang_argv.at(0), &clang_argv.last(), + trans_mode, resources_path); } if (err == ErrorCCompileErrors && errors_len > 0) { |
