1 /* Diagnostics <assert.h>
3 This file is part of the Public Domain C Library (PDCLib).
4 Permission is granted to use, modify, and / or redistribute at will.
7 #include <_PDCLIB_aux.h>
8 #include <_PDCLIB_config.h>
10 #ifndef _PDCLIB_ASSERT_H
11 #define _PDCLIB_ASSERT_H _PDCLIB_ASSERT_H
12 #if _PDCLIB_C_VERSION == 99
13 void _PDCLIB_assert( char const * const, char const * const, char const * const );
15 void _PDCLIB_assert( char const * const );
19 /* If NDEBUG is set, assert() is a null operation. */
23 #define assert( ignore ) ( (void) 0 )
25 #if _PDCLIB_C_VERSION == 99
26 #define assert( expression ) ( ( expression ) ? (void) 0 \
27 : _PDCLIB_assert( "Assertion failed: " #expression \
28 ", function ", __func__, \
30 ", line " _PDCLIB_symbol2string( __LINE__ ) \
33 #define assert( expression ) ( ( expression ) ? (void) 0 \
34 : _PDCLIB_assert( "Assertion failed: " #expression \
36 ", line " _PDCLIB_symbol2string( __LINE__ ) \