X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=internals%2F_PDCLIB_aux.h;h=16e7ed86ce0353b1055da508ed65702eb0125900;hp=484e930f24618c24fbee7dc563835e441ceeed35;hb=25241f49cbda2d67169a3f072b43ad6bc0b8dba9;hpb=5af6a81428deb4542b01eed33f450057c7fa89c2 diff --git a/internals/_PDCLIB_aux.h b/internals/_PDCLIB_aux.h index 484e930..16e7ed8 100644 --- a/internals/_PDCLIB_aux.h +++ b/internals/_PDCLIB_aux.h @@ -249,11 +249,18 @@ /* Helper macros: */ /* _PDCLIB_cc( x, y ) concatenates two preprocessor tokens without extending */ /* _PDCLIB_concat( x, y ) concatenates two preprocessor tokens with extending */ +/* _PDCLIB_concat3( x, y, z ) is the same for three tokens */ +/* _PDCLIB_static_assert( x ) provides a compile-time check mechanism */ /* -------------------------------------------------------------------------- */ #define _PDCLIB_cc( x, y ) x ## y #define _PDCLIB_concat( x, y ) _PDCLIB_cc( x, y ) #define _PDCLIB_concat3( x, y, z ) _PDCLIB_concat( _PDCLIB_concat( x, y ), z ) +#if _PDCLIB_C_VERSION >= 2011 +#define _PDCLIB_static_assert _Static_assert +#else +#define _PDCLIB_static_assert( e, m ) ;enum { _PDCLIB_concat( _PDCLIB_assert_, __LINE__ ) = 1 / ( !!( e ) ) } +#endif #define _PDCLIB_symbol2value( x ) #x #define _PDCLIB_symbol2string( x ) _PDCLIB_symbol2value( x )