1
2
3
4
5
6
7
8
9
10
11
#define QUOTE(x) # x
#define QUOTEW(x) QUOTE(x)
#define QUOTE_LINE QUOTEW(__LINE__)
#if defined(SIMULATOR)
#define DEBUG_OUT(fmt,...) DEBUGF("%s(" QUOTE_LINE "): " fmt "\n", __FUNCTION__ , ## __VA_ARGS__)
#elif defined(ROCKBOX_HAS_LOGF)
#define DEBUG_OUT(fmt,...) LOGF("%s(" QUOTE_LINE "): " fmt, __FUNCTION__ , ## __VA_ARGS__)
#else
#define DEBUG_OUT(...)
#endif
#define ASSERT(expr) if (!(expr)) DEBUG_OUT("assertion failed: (" QUOTEW(expr) ")")