home *** CD-ROM | disk | FTP | other *** search
/ Game Audio Programming / GameAudioProgramming.iso / Extras / Sensaura / SDK1.0 / data1.cab / Example_Files / ZoomFX / Debug.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-13  |  1.7 KB  |  80 lines

  1. /*
  2.     Company:            Sensaura Ltd
  3.     Copyright:          (C) 2000
  4.  
  5.     File Name:            Debug.h
  6.     File Description:    Debugging support functions, definitions and macros
  7.     Author:                Adam Philp
  8.     Last Update:        04-JAN-00
  9.  
  10.     Target Compiler:    Microsoft Visual C++ Version 5.0
  11. */
  12.  
  13. #ifndef __DEBUG_H        // Only use file if not already included
  14. #define __DEBUG_H
  15.  
  16. #define TRY(x)            if(!(x)) goto TRY_ERROR;
  17.  
  18. #ifdef _DEBUG            // Debug macros expand to functions only in debug build
  19.  
  20. #ifndef FALSE
  21. #define FALSE           0
  22. #endif
  23.  
  24. #ifndef TRUE
  25. #define TRUE            (!FALSE)
  26. #endif
  27.  
  28. #ifndef PTRACE
  29. #ifdef _PTRACE
  30. #define PTRACE            DebugTracePrepare(__FILE__, __LINE__); DebugOutput
  31. #else
  32. #define PTRACE
  33. #endif
  34. #endif
  35.  
  36. #ifndef TRACE
  37. #define TRACE            DebugTracePrepare(__FILE__, __LINE__); DebugTrace
  38. #define TRACEDISABLE    DebugTraceDisable();
  39. #define TRACEENABLE        DebugTraceEnable();
  40. #endif
  41.  
  42. #ifndef TRACEERROR
  43. #define TRACEERROR        DebugTracePrepare(__FILE__, __LINE__); DebugError
  44. #endif
  45.  
  46. #ifndef ASSERT
  47. #include <crtdbg.h>
  48. #define ASSERT            _ASSERT
  49. #define VERIFY          ASSERT
  50. #endif
  51.  
  52. #ifdef __cplusplus
  53. extern "C" {
  54. #endif
  55.  
  56. extern void DebugTracePrepare(const char* lpcszFileName, int NumLine);
  57. extern void DebugTrace(int DebugLevel, const char* lpcszFormat, ...);
  58. extern void DebugError(const char* lpcszFormat, ...);
  59. extern void DebugOutput(const char* lpcszFormat, ...);
  60. extern void DebugTraceDisable();
  61. extern void DebugTraceEnable();
  62.  
  63. #ifdef __cplusplus
  64. }
  65. #endif
  66.  
  67. #else                    // (#ifdef _DEBUG) Macros expand to nothing in release build
  68.  
  69. #define PTRACE
  70. #define TRACE
  71. #define TRACEERROR
  72. #define TRACEDISABLE
  73. #define TRACEENABLE
  74. #define ASSERT
  75. #define VERIFY
  76. #define    END
  77.  
  78. #endif                    // (#ifdef _DEBUG)
  79.  
  80. #endif                    // __DEBUG_H