Changes in src/libcfa/assert.c [57f408e:9d944b2]
- File:
-
- 1 edited
-
src/libcfa/assert.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/assert.c
r57f408e r9d944b2 17 17 #include "stdlib" // abort 18 18 19 #include "libhdr/libdebug.h" 20 19 21 extern "C" { 20 22 #include <stdarg.h> // varargs … … 23 25 extern const char * __progname; // global name of running executable (argv[0]) 24 26 25 #define CFA_ASSERT_FMT " *CFA assertion error*from program \"%s\" in \"%s\" at line %d in file \"%s\""27 #define CFA_ASSERT_FMT "Cforall Assertion error from program \"%s\" in \"%s\" at line %d in file \"%s\"" 26 28 27 29 // called by macro assert in assert.h 28 30 void __assert_fail( const char *assertion, const char *file, unsigned int line, const char *function ) { 29 fprintf( stderr,CFA_ASSERT_FMT ".\n", __progname, function, line, file );31 __lib_debug_print_safe( CFA_ASSERT_FMT ".\n", __progname, function, line, file ); 30 32 abort(); 31 33 } … … 33 35 // called by macro assertf 34 36 void __assert_fail_f( const char *assertion, const char *file, unsigned int line, const char *function, const char *fmt, ... ) { 35 fprintf( stderr, CFA_ASSERT_FMT ": ", __progname, function, line, file ); 37 __lib_debug_acquire(); 38 __lib_debug_print_nolock( CFA_ASSERT_FMT ": ", __progname, function, line, file ); 39 36 40 va_list args; 37 41 va_start( args, fmt ); 38 vfprintf( stderr,fmt, args );42 __lib_debug_print_vararg( fmt, args ); 39 43 va_end( args ); 40 fprintf( stderr, "\n" ); 44 45 __lib_debug_print_nolock( "\n" ); 46 __lib_debug_release(); 41 47 abort(); 42 48 }
Note:
See TracChangeset
for help on using the changeset viewer.