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