2
0
mirror of https://github.com/xcat2/xNBA.git synced 2025-01-18 21:43:14 +00:00

Don't include __FUNCTION__ in assert() messages; it was causing the

function name to appear within the objects even in non-asserting
builds.  (This could be considered a gcc bug.)

Removing __FUNCTION__ from assert() reduces the size of bin/blib.a by
around 2.5%!
This commit is contained in:
Michael Brown 2007-01-04 13:48:13 +00:00
parent 20681d6168
commit 350603cb86

View File

@ -38,13 +38,12 @@ assert_printf ( const char *fmt, ... ) asm ( "printf" );
* @todo Make an assertion failure abort the program
*
*/
#define assert( condition ) \
do { \
if ( ASSERTING && ! (condition) ) { \
assert_printf ( "assert(%s) failed at %s line " \
"%d [%s]\n", #condition, __FILE__, \
__LINE__, __FUNCTION__ ); \
} \
#define assert( condition ) \
do { \
if ( ASSERTING && ! (condition) ) { \
assert_printf ( "assert(%s) failed at %s line %d\n", \
#condition, __FILE__, __LINE__ ); \
} \
} while ( 0 )
/**