1 #ifndef XDEBUG /* prevent circular inclusions */
2 #define XDEBUG /* by using protection macros */
4 #if defined(DEBUG) && !defined(NDEBUG)
8 #warning DEBUG is enabled
11 int printf(const char *format, ...);
13 #define XDBG_DEBUG_ERROR 0x00000001U /* error condition messages */
14 #define XDBG_DEBUG_GENERAL 0x00000002U /* general debug messages */
15 #define XDBG_DEBUG_ALL 0xFFFFFFFFU /* all debugging data */
17 #define xdbg_current_types (XDBG_DEBUG_GENERAL)
19 #define xdbg_stmnt(x) x
21 #define xdbg_printf(type, ...) (((type) & xdbg_current_types) ? printf (__VA_ARGS__) : 0)
24 #else /* defined(DEBUG) && !defined(NDEBUG) */
28 #define xdbg_printf(...)
30 #endif /* defined(DEBUG) && !defined(NDEBUG) */