Added VGM_DEBUG_OUTPUT flag to define debug logging utils

This commit is contained in:
bnnm 2016-12-27 14:28:12 +01:00
parent 1899a20934
commit 0f2627f8da

View File

@ -72,4 +72,21 @@ void concatn(int length, char * dst, const char * src);
void concatn_doublenull(int length, char * dst, const char * src);
void concatn_fitting_doublenull(int length, char * dst, const char * src);
/* Simple stdout logging for debugging and regression testing purposes.
* Needs C99 variadic macros. */
#ifdef VGM_DEBUG_OUTPUT
#define VGM_ASSERT(condition, ...) \
do { if (condition) printf(__VA_ARGS__); } while (0)
#define VGM_LOG(...) \
do { printf(__VA_ARGS__); } while (0)
#else
#define VGM_ASSERT(condition,fmt, ...) /* nothing */
#define VGM_LOG(...) /* nothing */
#endif
#endif