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(...@@ -286,7 +286,7 @@ fn render_autoconf(
286 try output.appendSlice("\n");286 try output.appendSlice("\n");
287 continue;287 continue;
288 }288 }
289 const name = it.rest();289 const name = it.next().?;
290 const index = values.getIndex(name) orelse {290 const index = values.getIndex(name) orelse {
291 try step.addError("{s}:{d}: error: unspecified config header value: '{s}'", .{291 try step.addError("{s}:{d}: error: unspecified config header value: '{s}'", .{
292 src_path, line_index + 1, name,292 src_path, line_index + 1, name,
test/standalone/config_header/build.zig+5
...@@ -12,6 +12,11 @@ pub fn build(b: *std.Build) void {...@@ -12,6 +12,11 @@ pub fn build(b: *std.Build) void {
12 .SOME_TEN = 10,12 .SOME_TEN = 10,
13 .SOME_ENUM_LITERAL = .@"test",13 .SOME_ENUM_LITERAL = .@"test",
14 .SOME_STRING = "test",14 .SOME_STRING = "test",
15
16 .PREFIX_SPACE = null,
17 .PREFIX_TAB = null,
18 .POSTFIX_SPACE = null,
19 .POSTFIX_TAB = null,
15 },20 },
16 );21 );
1722
test/standalone/config_header/config.h+5
...@@ -15,3 +15,8 @@ int foo();...@@ -15,3 +15,8 @@ int foo();
15// Used twice15// Used twice
16#define SOME_TRUE 116#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();...@@ -13,3 +13,8 @@ int foo();
1313
14// Used twice14// Used twice
15#undef SOME_TRUE15#undef SOME_TRUE
16
17#undef PREFIX_SPACE
18#undef PREFIX_TAB
19#undef POSTFIX_SPACE
20#undef POSTFIX_TAB