]> pd.if.org Git - pdclib/blobdiff - includes/assert.h
The other code did not work, and ((void)0) is actually specified in the standard.
[pdclib] / includes / assert.h
index 349c866f05ccde2664460bd164311d12d5f5d5eb..44b30b87b7bdbe98281ad086afed1162fb623a4c 100644 (file)
@@ -30,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)) { \