debug.h 523 B

123456789101112131415161718192021
  1. #ifndef __DEBUG_H__
  2. #define __DEBUG_H__
  3. #include <stdlib.h>
  4. #include <stdint.h>
  5. #include <stdarg.h>
  6. #if defined(NO_DEBUG) && defined(__GNUC__)
  7. /* gcc's cpp has extensions; it allows for macros with a variable number of
  8. arguments. We use this extension here to preprocess pmesg away. */
  9. #define debug(level, format, args...) ((void)0)
  10. #else
  11. void debug(int level, char *format, ...);
  12. /* print a message, if it is considered significant enough.
  13. Adapted from [K&R2], p. 174 */
  14. #endif
  15. #endif /* DEBUG_H */