VM: Refactor assert.hpp to Factor style

db4
Erik Charlebois 2013-05-11 21:42:22 -04:00
parent 76375afd1c
commit 9ef732743d
1 changed files with 8 additions and 12 deletions

View File

@ -1,16 +1,12 @@
namespace factor namespace factor { void abort(); }
{
void abort();
}
#ifdef FACTOR_DEBUG #ifdef FACTOR_DEBUG
#define FACTOR_ASSERT(condition) ((condition) \ #define FACTOR_ASSERT(condition) \
((condition) \
? (void) 0 \ ? (void) 0 \
: ( \ : (::fprintf(stderr, "assertion \"%s\" failed: file \"%s\", line %d\n", \
::fprintf(stderr, "assertion \"%s\" failed: file \"%s\", line %d\n", \
#condition, __FILE__, __LINE__), \ #condition, __FILE__, __LINE__), \
::factor::abort() \ ::factor::abort()))
))
#else #else
#define FACTOR_ASSERT(condition) ((void) 0) #define FACTOR_ASSERT(condition) ((void) 0)
#endif #endif