From c61847ca5830bea9b46dd0fa9f18d91e571ff81c Mon Sep 17 00:00:00 2001 From: Watson Wheeler Date: Sun, 28 Jun 2026 20:32:28 +1000 Subject: 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 --- include/tinyff/compat.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/tinyff/compat.h') 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 #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) -- cgit v1.2.3