mirror of
https://github.com/ziglang/zig.git
synced 2026-02-21 16:54:52 +00:00
Step.TranslateC: fix defineCMacro
This commit is contained in:
parent
815022c87b
commit
7205756a69
@ -107,7 +107,7 @@ pub fn addCheckFile(translate_c: *TranslateC, expected_matches: []const []const
|
||||
/// If the value is omitted, it is set to 1.
|
||||
/// `name` and `value` need not live longer than the function call.
|
||||
pub fn defineCMacro(translate_c: *TranslateC, name: []const u8, value: ?[]const u8) void {
|
||||
const macro = std.Build.constructranslate_cMacro(translate_c.step.owner.allocator, name, value);
|
||||
const macro = translate_c.step.owner.fmt("{s}={s}", .{ name, value orelse "1" });
|
||||
translate_c.c_macros.append(macro) catch @panic("OOM");
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user