35 lines
580 B
C
35 lines
580 B
C
|
|
#ifdef DEBUG_BUILD
|
|
extern int debug_depth;
|
|
#endif
|
|
|
|
#ifdef DEBUG_BUILD
|
|
#define ZDEBUG 1
|
|
#else
|
|
#define ZDEBUG 0
|
|
#endif
|
|
|
|
#ifdef DEBUG_BUILD
|
|
#define zprintf(fmt, ...) printf("%*s" fmt, debug_depth, "", ## __VA_ARGS__);
|
|
#else
|
|
#define zprintf(...);
|
|
#endif
|
|
|
|
#ifdef DEBUG_BUILD
|
|
#define ENTER \
|
|
{ zprintf("%s():" "\n", __PRETTY_FUNCTION__); debug_depth++; }
|
|
|
|
#define EXIT \
|
|
{ zprintf("return" "\n"); debug_depth--; }
|
|
#else
|
|
#define ENTER ;
|
|
|
|
#define EXIT ;
|
|
#endif
|
|
|
|
#define TODO \
|
|
assert(!"TODO");
|
|
|
|
#define CHECK \
|
|
assert(!"CHECK");
|
|
|