| author | |
| committer | |
| log | 4c18da1ef3ef21033394041be21774bf13882b54 |
| tree | 19508d193e02a964728839080bea0333e8c2eab6 |
| parent | bbb96e112cc555fd63fe305398c5b89b778e9c81 |
clang::ASTUnit::LoadFromCommandLine interprets the first argument as
the name of program (like the main function).
This change shifts the arguments passing "" for the first argument.2 files changed, 2 insertions(+), 0 deletions(-)
src/Compilation.zig+1| ... | ... | @@ -2557,6 +2557,7 @@ pub fn cImport(comp: *Compilation, c_src: []const u8) !CImportResult { |
| 2557 | 2557 | var argv = std.ArrayList([]const u8).init(comp.gpa); |
| 2558 | 2558 | defer argv.deinit(); |
| 2559 | 2559 | |
| 2560 | try argv.append(""); // argv[0] is program name, actual args start at [1] | |
| 2560 | 2561 | try comp.addTranslateCCArgs(arena, &argv, .c, out_dep_path); |
| 2561 | 2562 | |
| 2562 | 2563 | try argv.append(out_h_path); |
src/main.zig+1| ... | ... | @@ -2492,6 +2492,7 @@ fn cmdTranslateC(comp: *Compilation, arena: *Allocator, enable_cache: bool) !voi |
| 2492 | 2492 | |
| 2493 | 2493 | const digest = if (try man.hit()) man.final() else digest: { |
| 2494 | 2494 | var argv = std.ArrayList([]const u8).init(arena); |
| 2495 | try argv.append(""); // argv[0] is program name, actual args start at [1] | |
| 2495 | 2496 | |
| 2496 | 2497 | var zig_cache_tmp_dir = try comp.local_cache_directory.handle.makeOpenPath("tmp", .{}); |
| 2497 | 2498 | defer zig_cache_tmp_dir.close(); |