translate_c: fix ternary operator output in C macros

This commit is contained in:
Jacob
2025-08-02 16:39:07 +08:00
committed by Alex Rønne Petersen
parent 0795e2b2ef
commit ab6dbfe1a3
3 changed files with 27 additions and 5 deletions

View File

@@ -3101,8 +3101,8 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
\\ int a, b, c;
\\#define FOO a ? b : c
, &[_][]const u8{
\\pub inline fn FOO() @TypeOf(if (a) b else c) {
\\ return if (a) b else c;
\\pub inline fn FOO() @TypeOf(if (a != 0) b else c) {
\\ return if (a != 0) b else c;
\\}
});