3 /* 7.2 Diagnostics <assert.h>
5 This file is part of the Public Domain C Library (PDCLib).
6 Permission is granted to use, modify, and / or redistribute at will.
9 #ifndef _PDCLIB_ASSERT_H
10 #define _PDCLIB_ASSERT_H _PDCLIB_ASSERT_H
11 #include <_PDCLIB_aux.h>
12 #include <_PDCLIB_config.h>
13 _PDCLIB_BEGIN_EXTERN_C
15 void _PDCLIB_assert99( char const * const, char const * const, char const * const );
16 void _PDCLIB_assert89( char const * const );
18 /* If NDEBUG is set, assert() is a null operation. */
22 #define assert( ignore ) ( (void) 0 )
23 #elif _PDCLIB_C_VERSION >= 99
24 #define assert(expression) \
25 do { if(!(expression)) \
26 _PDCLIB_assert99("Assertion failed: " #expression \
27 ", function ", __func__, \
29 ", line " _PDCLIB_symbol2string( __LINE__ ) \
33 #define assert(expression) \
36 _PDCLIB_assert89( "Assertion failed: " #expression \
38 ", line " _PDCLIB_symbol2string( __LINE__ ) \