00001 #ifndef __VM_ASSERT_H__ 00002 #define __VM_ASSERT_H__ 00003 00004 #include "vm.h" 00005 #include <stdio.h> 00006 00012 extern void _vm_assert_fail(const char* assertion, const char*file, unsigned int line, const char* function); 00013 00014 #ifdef NODEBUG 00015 #define assert(_x_) 00016 #else 00017 00018 #define assert(_x_) \ 00019 ((_x_) \ 00020 ? ((void)0) \ 00021 : _vm_assert_fail( "Assertion failed : " #_x_ , __FILE__, __LINE__, __func__ )) 00022 #endif 00023 00025 #define vm_fatal(_str) _vm_assert_fail( _str , __FILE__, __LINE__, __func__ ) 00026 00029 #endif 00030