From 75dc2349882c563e7646715bf2933ac50cf6753f Mon Sep 17 00:00:00 2001 From: Greg King Date: Fri, 21 Aug 2020 15:15:19 -0400 Subject: [PATCH] Guarded the static_assert macro with a C standards test. --- include/assert.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/include/assert.h b/include/assert.h index 3f8b46ac0..a4dcd5d7f 100644 --- a/include/assert.h +++ b/include/assert.h @@ -46,16 +46,14 @@ extern void __fastcall__ _afailed (const char*, unsigned); # define assert(expr) ((expr)? (void)0 : _afailed(__FILE__, __LINE__)) #endif -/* -** TODO: Guard with #if __STDC_VERSION__ >= 201112L or similar when there +/* TODO: Guard with #if __CC65_STD__ >= __CC65_STD_C11__ if there ** is a C11 mode. */ -#define static_assert _Static_assert +#if __CC65_STD__ > __CC65_STD_C99__ +# define static_assert _Static_assert +#endif /* End of assert.h */ #endif - - -