1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
#if defined(DEBUG) && !defined(ETTERCAP_DEBUG_H)
#define ETTERCAP_DEBUG_H
EC_API_EXTERN void debug_init(void);
EC_API_EXTERN void debug_msg(const char *message, ...);
EC_API_EXTERN FILE *debug_file;
#define DEBUG_INIT() debug_init()
#define DEBUG_MSG(x, ...) do { \
if (debug_file == NULL) { \
fprintf(stderr, "DEBUG: "x"\n", ## __VA_ARGS__ ); \
} else \
debug_msg(x, ## __VA_ARGS__ ); \
} while(0)
#endif /* EC_DEBUG_H */
/*
* if DEBUG is not defined we expand the macros to null instructions...
*/
#ifndef DEBUG
#define DEBUG_INIT()
#define DEBUG_MSG(x, ...)
#endif
/* EOF */
// vim:ts=3:expandtab
|