diff options
| author | Watson Wheeler <git@tazy.dev> | 2026-06-28 20:32:28 +1000 |
|---|---|---|
| committer | Watson Wheeler <git@tazy.dev> | 2026-07-02 19:39:07 +1000 |
| commit | ecac8276be96da73512be6823e793b0952f29694 (patch) | |
| tree | 04ffe0cf90950c81b3da89543806dcee9998b9be /include/tinyff | |
| parent | c6f5ecdbbd82989f4641fe193e9d76de97446d03 (diff) | |
fix(compat): fix c99 static_assert LINE macro expansion
Added a wrapper (COMPAT_PASTE) to ensure LINE gets expanded properly
Signed-off-by: Watson Wheeler <git@tazy.dev>
Diffstat (limited to 'include/tinyff')
| -rw-r--r-- | include/tinyff/compat.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/tinyff/compat.h b/include/tinyff/compat.h index 0199513..1d64684 100644 --- a/include/tinyff/compat.h +++ b/include/tinyff/compat.h @@ -26,12 +26,12 @@ // Static assertion fallback for c99 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L - // static_assert already in version # include <assert.h> #else - // c99 dummy +# define COMPAT_PASTE_INNER(a, b) a ## b +# define COMPAT_PASTE(a, b) COMPAT_PASTE_INNER(a, b) # define COMPAT_STATIC_ASSERT(expr, msg) \ - typedef char compat_assertion_failed##__LINE__[(expr) ? 1 : -1] + typedef char COMPAT_PASTE(compat_assertion_failed_, __LINE__)[(expr) ? 1 : -1] # undef static_assert # define static_assert(expr, msg) COMPAT_STATIC_ASSERT(expr, msg) |
