]> gitweb.factorcode.org Git - factor.git/blob - vm/assert.hpp
vm: replace assert with FACTOR_ASSERT
[factor.git] / vm / assert.hpp
1 namespace factor
2 {
3     void abort();
4 }
5
6 #ifndef NDEBUG
7 #define FACTOR_ASSERT(condition) ((condition) \
8     ? (void)0 \
9     : ( \
10         ::fprintf(stderr, "assertion \"%s\" failed: file \"%s\", line %d\n", \
11             #condition, __FILE__, __LINE__), \
12         ::factor::abort() \
13     ))
14 #else
15 #define FACTOR_ASSERT(condition) ((void)0)
16 #endif