authorgravatar for techatrix@mailbox.orgTechatrix <techatrix@mailbox.org> 2025-02-19 09:04:08+01:00
committergravatar for techatrix@mailbox.orgTechatrix <techatrix@mailbox.org> 2025-02-19 09:34:26+01:00
log344db9e26bfb7a966cb99d73fa13c7d6845c2ce9
treed0f7f7c0783719f396298b86c67aa08e911ac2b2
parent7e548af8b1527d2d04de1c12df9bf8afd1ad23ea
signaturebadge-check Signed by SSH key SHA256:HYC3SjXQcAt6uwv9pu/6OoVQ2rUH8rb5zKiUHSe9uxk

std.Build.Step.ConfigHeader: skip trailing whitespace in autoconf header


4 files changed, 16 insertions(+), 1 deletions(-)

lib/std/Build/Step/ConfigHeader.zig+1-1
......@@ -286,7 +286,7 @@ fn render_autoconf(
286286 try output.appendSlice("\n");
287287 continue;
288288 }
289 const name = it.rest();
289 const name = it.next().?;
290290 const index = values.getIndex(name) orelse {
291291 try step.addError("{s}:{d}: error: unspecified config header value: '{s}'", .{
292292 src_path, line_index + 1, name,
test/standalone/config_header/build.zig+5
......@@ -12,6 +12,11 @@ pub fn build(b: *std.Build) void {
1212 .SOME_TEN = 10,
1313 .SOME_ENUM_LITERAL = .@"test",
1414 .SOME_STRING = "test",
15
16 .PREFIX_SPACE = null,
17 .PREFIX_TAB = null,
18 .POSTFIX_SPACE = null,
19 .POSTFIX_TAB = null,
1520 },
1621 );
1722
test/standalone/config_header/config.h+5
......@@ -15,3 +15,8 @@ int foo();
1515// Used twice
1616#define SOME_TRUE 1
1717
18/* #undef PREFIX_SPACE */
19/* #undef PREFIX_TAB */
20/* #undef POSTFIX_SPACE */
21/* #undef POSTFIX_TAB */
22
test/standalone/config_header/config.h.in+5
......@@ -13,3 +13,8 @@ int foo();
1313
1414// Used twice
1515#undef SOME_TRUE
16
17#undef PREFIX_SPACE
18#undef PREFIX_TAB
19#undef POSTFIX_SPACE
20#undef POSTFIX_TAB