home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / GCC / GERLIB_DEV08B.LHA / gerlib / libg++ / gperf / src / trace.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-12  |  337 b   |  21 lines

  1. #ifndef trace_h
  2. #define trace_h 1
  3.  
  4. #ifdef TRACE
  5. #define T(X) X
  6. #else
  7. #define T(X)
  8. #endif
  9.  
  10. class Trace
  11. {
  12. private:
  13.   static int nesting;
  14.   char *name;
  15. public:
  16.   Trace (char *n) { fprintf (stderr, "%*scalling %s\n", 3 * nesting++, "", name = n); }
  17.  ~Trace (void) { fprintf (stderr, "%*sleaving %s\n", 3 * --nesting, "", name); }
  18. };
  19.  
  20. #endif
  21.