mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-28 08:20:54 +01:00
Added VGM_DEBUG_OUTPUT flag to define debug logging utils
This commit is contained in:
parent
1899a20934
commit
0f2627f8da
17
src/util.h
17
src/util.h
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user