debug.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /* $Id$ */
  2. /*
  3. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  4. * See the copyright notice in the ACK home directory, in the file "Copyright".
  5. */
  6. /* D E B U G G I N G T O O L S */
  7. #include "types.h"
  8. /* TEMPORARY: */
  9. /* #define DEBUG */
  10. extern int linecount; /* # lines in this file */
  11. extern bool verbose_flag; /* generate verbose output ? */
  12. #ifdef __STDC__
  13. /* VARARGS 1 */
  14. void error(char *fmt, ...);
  15. # ifdef TRACE
  16. void OUTTRACE(char *s, ...);
  17. # else /* TRACE */
  18. # define OUTTRACE(s,n)
  19. # endif /* TRACE */
  20. # ifdef VERBOSE
  21. void OUTVERBOSE(char *s, ...);
  22. # else /* VERBOSE */
  23. # define OUTVERBOSE(s,n1,n2)
  24. # endif /* VERBOSE */
  25. #else /* __STDC__ */
  26. /* VARARGS 1 */
  27. extern error();
  28. # ifdef TRACE
  29. extern OUTTRACE();
  30. # else /* TRACE */
  31. # define OUTTRACE(s,n)
  32. # endif /* TRACE */
  33. # ifdef VERBOSE
  34. extern OUTVERBOSE();
  35. # else /* VERBOSE */
  36. # define OUTVERBOSE(s,n1,n2)
  37. # endif /* VERBOSE */
  38. #endif /* __STDC__ */
  39. #ifdef DEBUG
  40. /* Some (all?) Unix debuggers don't particularly like
  41. * static procedures and variables. Therefor we make everything
  42. * global when debugging.
  43. */
  44. #define STATIC
  45. #define assert(x) if(!(x)) badassertion(__FILE__,__LINE__)
  46. extern VI();
  47. extern VL();
  48. extern VD();
  49. extern VA();
  50. extern VO();
  51. extern VP();
  52. #else /*DEBUG*/
  53. #define assert(b)
  54. #define VI(i)
  55. #define VL(l)
  56. #define VD(d)
  57. #define VA(a)
  58. #define VO(o)
  59. #define VP(p)
  60. #define STATIC static
  61. #endif