authorgravatar for michaldrozd@protonmail.chfardragon <michaldrozd@protonmail.ch> 2026-06-05 23:06:41+02:00
committergravatar for michaldrozd@protonmail.chfardragon <michaldrozd@protonmail.ch> 2026-06-05 21:07:37+00:00
logcae8952548518c9504ca40f5212cafa79622f04b
tree39d8b57987573a5fcf581556f612aaacf4ca3487
parent1eb3c64ea4ae4badbb71c92245de194b7fe7e1c4

Work around multiline string literals weirdness


2 files changed, 5 insertions(+), 14 deletions(-)

lib/compiler/Maker/Step/ConfigHeader.zig+4-8
......@@ -392,17 +392,13 @@ fn renderBlank(
392392 };
393393
394394 try w.print(
395 \\#ifndef {[0]f}
396 \\#define {[0]f}
397 \\
398 , .{include_guard_fmt});
395 "#ifndef {[0]f}{[1]s}#define {[0]f}{[1]s}",
396 .{ include_guard_fmt, os_newline },
397 );
399398
400399 for (value_map.keys(), value_pairs) |name, pair| try renderValueC(conf, w, os_newline, name, pair.index);
401400
402 try w.print(
403 \\#endif /* {f} */
404 \\
405 , .{include_guard_fmt});
401 try w.print("#endif /* {f} */{s}", .{ include_guard_fmt, os_newline });
406402}
407403
408404const IncludeGuardFmt = struct {
test/standalone/config_header/build.zig+1-6
......@@ -16,18 +16,17 @@ pub fn build(b: *std.Build) void {
1616 .SOME_ENUM = @as(enum { foo, bar }, .foo),
1717 .SOME_ENUM_LITERAL = .@"test",
1818 .SOME_STRING = "test",
19
2019 .PREFIX_SPACE = null,
2120 .PREFIX_TAB = null,
2221 .POSTFIX_SPACE = null,
2322 .POSTFIX_TAB = null,
24
2523 .SOME_UNDERSCORED = true,
2624 },
2725 );
2826 const check_config_header = b.addCheckFile(config_header.getOutputFile(), .{
2927 .expected_exact = @embedFile("autoconf_undef/config.h"),
3028 });
29 test_step.dependOn(&check_config_header.step);
3130
3231 const config_header_autoconf_at = b.addConfigHeader(
3332 .{ .style = .{ .autoconf_at = b.path("autoconf_at/autoconf_at.h.in") } },
......@@ -39,7 +38,6 @@ pub fn build(b: *std.Build) void {
3938 .integer = 42,
4039 .string = "text",
4140 .string_at = "@string@",
42
4341 .underscored_var = "value",
4442 .at_sign = "@",
4543 },
......@@ -47,8 +45,6 @@ pub fn build(b: *std.Build) void {
4745 const check_config_header_autoconf_at = b.addCheckFile(config_header_autoconf_at.getOutputFile(), .{
4846 .expected_exact = @embedFile("autoconf_at/autoconf_at.h"),
4947 });
50
51 test_step.dependOn(&check_config_header.step);
5248 test_step.dependOn(&check_config_header_autoconf_at.step);
5349
5450 const config_header_blank = b.addConfigHeader(
......@@ -109,7 +105,6 @@ fn addCmakeChecks(b: *std.Build, test_step: *std.Build.Step) void {
109105 .ONEVAL = 1,
110106 .TENVAL = 10,
111107 .STRINGVAL = "test",
112
113108 .BOOLNOVAL = {},
114109 .BOOLTRUEVAL = true,
115110 .BOOLFALSEVAL = false,