Changeset 1cb2282 for src/main.cc
- Timestamp:
- Aug 18, 2016, 4:59:11 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 99cad3aa
- Parents:
- 3b8e52c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main.cc
r3b8e52c r1cb2282 10 10 // Created On : Fri May 15 23:12:02 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Aug 17 22:13:38201613 // Update Count : 34 112 // Last Modified On : Thu Aug 18 16:33:49 2016 13 // Update Count : 347 14 14 // 15 15 … … 70 70 static void dump( std::list< Declaration * > & translationUnit, std::ostream & out = std::cout ); 71 71 72 //************************************************73 74 #define __STRINGIFY__(str) #str75 #define __VSTRINGIFY__(str) __STRINGIFY__(str)76 #define assertf(expr, fmt, ...) ((expr) ? static_cast<void>(0) : __assert_fail_f(__VSTRINGIFY__(expr), __FILE__, __LINE__, __PRETTY_FUNCTION__, fmt, ## __VA_ARGS__ ))77 #define CFA_ASSERT_FMT "*CFA assertion error* from program \"%s\" in \"%s\" at line %d in file \"%s\": "78 79 extern const char * __progname; // global name of running executable (argv[0])80 // called by macro assert in assert.h81 void __assert_fail( const char *assertion, const char *file, unsigned int line, const char *function ) {82 fprintf( stderr, CFA_ASSERT_FMT, __progname, function, line, file );83 exit( EXIT_FAILURE );84 }85 86 #include <cstdarg>87 // called by macro assertf88 void __assert_fail_f( const char *assertion, const char *file, unsigned int line, const char *function, const char *fmt, ... ) {89 fprintf( stderr, CFA_ASSERT_FMT, __progname, function, line, file );90 va_list args;91 va_start( args, fmt );92 vfprintf( stderr, fmt, args );93 exit( EXIT_FAILURE );94 }95 96 //************************************************97 98 72 int main( int argc, char * argv[] ) { 99 73 FILE * input; // use FILE rather than istream because yyin is FILE … … 408 382 } // dump 409 383 410 411 412 384 // Local Variables: // 413 385 // tab-width: 4 //
Note: See TracChangeset
for help on using the changeset viewer.