X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=includes%2Fassert.h;h=44b30b87b7bdbe98281ad086afed1162fb623a4c;hp=0d06472fbdaac089c85cd8c6ad5715460c669e78;hb=0b6ba474c9a13ef218554539106c0a52776ac189;hpb=6608f7d9a9a3326666d825de38fdd216a9ddf049 diff --git a/includes/assert.h b/includes/assert.h index 0d06472..44b30b8 100644 --- a/includes/assert.h +++ b/includes/assert.h @@ -1,5 +1,3 @@ -/* $Id$ */ - /* 7.2 Diagnostics This file is part of the Public Domain C Library (PDCLib). @@ -32,16 +30,19 @@ _PDCLIB_BEGIN_EXTERN_C void _PDCLIB_assert99( char const * const, char const * const, char const * const ); void _PDCLIB_assert89( char const * const ); +#if _PDCLIB_C_VERSION >= 2011 +#define static_assert _Static_assert +#else +#define static_assert( e, m ) +#endif + #endif /* If NDEBUG is set, assert() is a null operation. */ #undef assert #ifdef NDEBUG -#define assert( ignore ) do { \ - if(!(expression)) { _PDCLIB_UNREACHABLE; } \ - } while(0) - +#define assert( ignore ) ( (void) 0 ) #elif _PDCLIB_C_MIN(99) #define assert(expression) \ do { if(!(expression)) { \