home *** CD-ROM | disk | FTP | other *** search
- #ifndef _DEBUGUTILS_
- #define _DEBUGUTILS_
-
- #include <ConditionalMacros.h>
- #include <MacTypes.h>
-
-
- // Default: Call Traces off
- #ifndef CALLTRACE
- #define CALLTRACE 0
- #endif
-
- // Default: Debugging off
- #ifndef DEBUG
- #define DEBUG 0
- #endif
-
- // Local Call Traces override?
- #if DISABLE_LOCAL_CALLTRACE
- #undef CALLTRACE
- #define CALLTRACE 0
- #endif
-
- // Local Debugging override?
- #if DISABLE_LOCAL_DEBUG
- #undef DEBUG
- #define DEBUG 0
- #endif
-
- // !DEBUG --> !DCON
- #if !DEBUG
- #ifdef DCON
- #undef DCON
- #endif
- #define DCON 0
- #endif
-
- #include "DCon.h"
-
-
- #if DEBUG && CALLTRACE
- typedef class CallTrace
- {
- public:
- #if TARGET_RT_MAC_CFM
- static UInt32 fLevel;
- #endif
- char *fName;
- #if CALLTRACE_TIMER
- UInt64 fTime;
- #endif
-
- CallTrace(char *func);
- ~CallTrace(void);
-
- private:
- void *operator new(unsigned long) { return NULL; }
- void operator delete(void *) { }
- } CallTrace;
- #else
- #define CallTrace typedef int
- #define trace(x) __ignore_me__
- #endif
-
-
- #if DEBUG
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- void DebugStrf(char *format,...);
- void BinaryPrintout(UInt32 val, int numBits);
-
- #ifdef __cplusplus
- }
- #endif
- #else
- #define DebugStrf while(0)
- #define BinaryPrintout while(0)
- #endif
-
-
- #endif /* _DEBUGUTILS_ */
-