no assert/debugprint in release builds

This commit is contained in:
Tim Felgentreff 2022-06-28 21:38:23 +02:00
parent 109bc10e0f
commit beab00da26

View file

@ -139,14 +139,22 @@ extern void PrintOnStdOut(const char *format, ...);
/**
** Assert a condition. If cond is not true abort with file,line.
*/
#ifdef DEBUG
#define Assert(cond) \
do { if (EnableAssert && !(cond)) { AbortAt(__FILE__, __LINE__, __func__, #cond); }} while (0)
#else
#define Assert(cond)
#endif
/**
** Print debug information with function name.
*/
#ifdef DEBUG
#define DebugPrint(args) \
do { if (EnableDebugPrint) { PrintFunction(); PrintOnStdOut(args); } } while (0)
#else
#define DebugPrint(args)
#endif
/*============================================================================
== Definitions