Skip to content

Commit

Permalink
translate-c: support macro with 'assert(false && "error message")'
Browse files Browse the repository at this point in the history
closes ziglang#14642 with modified fix suggested by Vexu in
ziglang#14642 (comment)
  • Loading branch information
travisstaloch authored Apr 11, 2024
1 parent d0275a9 commit 07b17e8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions translate_c/assert_with_strlit.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

void assert(int x) {}
#define FOO assert(0 && "error message")

// translate-c
// c_frontend=clang
//
// pub const FOO = assert((@as(c_int, 0) != 0) and (@intFromPtr("error message") != 0));

0 comments on commit 07b17e8

Please sign in to comment.