4 #define empty_body do {} while(0)
5 #if defined(__x86_64) || defined(__x86_64__)
7 #elif defined(__x86) || defined(__x86__) || defined(__i386) || defined(__i386__)
11 //#define NO_BREAKPOINTS
13 # define breakpoint() empty_body
16 # define breakpoint() __asm__("int3")
20 # define breakpoint() kill(getpid(), SIGTRAP)
26 # define assert_dbg(exp) empty_body
27 # define assert_lt(exp) empty_body
28 # define assert_lte(exp) empty_body
29 # define assert(x) empty_body
32 # define assert_dbg(exp) do { if (!(exp)) breakpoint(); } while(0)
33 # define assert_op(val, op, max) do { if(!((val) op (max))) { \
34 fprintf(stderr, "[%s:%d] %s: assert failed: %s < %s\n", \
35 __FILE__, __LINE__, __FUNCTION__, # val, # max); \
36 breakpoint();}} while(0)
38 # define assert_lt (val, max) assert_op(val, <, max)
39 # define assert_lte(val, max) assert_op(val, <= ,max)