Changeset 78d3dd5 for src/libcfa/assert.c
- Timestamp:
- Mar 31, 2017, 12:24:39 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 5ea06d6
- Parents:
- 72dc82a (diff), 077810d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/assert.c
r72dc82a r78d3dd5 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.