vm_assert macros fix up
This commit is contained in:
parent
b8eedfee6b
commit
09a47e6a40
@ -8,15 +8,15 @@
|
|||||||
#define ELEMENTS(a) (sizeof(a)/sizeof((a)[0]))
|
#define ELEMENTS(a) (sizeof(a)/sizeof((a)[0]))
|
||||||
|
|
||||||
#if SANITYCHECKS
|
#if SANITYCHECKS
|
||||||
#define vm_assert(cond) { \
|
#define vm_assert(cond) do { \
|
||||||
if(vm_sanitychecklevel > 0 && !(cond)) { \
|
if(vm_sanitychecklevel > 0 && !(cond)) { \
|
||||||
printf("VM:%s:%d: assert failed: %s\n", \
|
printf("VM:%s:%d: assert failed: %s\n", \
|
||||||
__FILE__, __LINE__, #cond); \
|
__FILE__, __LINE__, #cond); \
|
||||||
panic("VM", "assert failed", NO_NUM); \
|
panic("VM", "assert failed", NO_NUM); \
|
||||||
} \
|
} \
|
||||||
}
|
} while(0)
|
||||||
#else
|
#else
|
||||||
#define vm_assert(cond) ;
|
#define vm_assert(cond)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define vm_panic(str, n) { char _pline[100]; \
|
#define vm_panic(str, n) { char _pline[100]; \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user