4-variable-simplifier/debug.h
2025-06-28 08:25:30 -05:00

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");