home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / programs / patches / newbar / Source / NewBar / h / debug next >
Encoding:
Text File  |  1998-08-07  |  929 b   |  41 lines

  1.  
  2. /* debug.h */
  3.  
  4. #ifndef ibarpatch_debug_H
  5. #define ibarpatch_debug_H
  6.  
  7. #include <stdio.h>
  8.  
  9.  
  10. /* Some diagnostic macros */
  11.  
  12. #ifdef DEBUG
  13. #  define DEBUGF(s) fprintf(stderr, (s))
  14. #  define DEBUGF1(s, a1) fprintf(stderr, (s), (a1))
  15. #  define DEBUGF2(s, a1, a2) fprintf(stderr, (s), (a1), (a2))
  16. #  define DEBUGF3(s, a1, a2, a3) fprintf(stderr, (s), (a1), (a2), (a3))
  17. #else
  18. #  define DEBUGF(s) ((void) 0)
  19. #  define DEBUGF1(s, a1) ((void) 0)
  20. #  define DEBUGF2(s, a1, a2) ((void) 0)
  21. #  define DEBUGF3(s, a1, a2, a3) ((void) 0)
  22. #endif
  23.  
  24. /* Logs function calls */
  25. #define LOGFUNC(leaf)    DEBUGF(MODULE_NAME ": entering " #leaf "\n")
  26.  
  27.  
  28. #if 0
  29.  
  30. #include "OS:os.h"
  31.  
  32. /* Rather desperate debugging code:  Turns the screen border a different
  33.    colour throughout suspect code.  Useful if the machine crashes. */
  34. #define SUSPECT_BEGIN(col)    palettev_set_entry(0, 24, (col), (col))
  35. #define SUSPECT_END()        palettev_set_entry(0, 24, 0, 0)
  36.  
  37. #endif
  38.  
  39.  
  40. #endif
  41.