home *** CD-ROM | disk | FTP | other *** search
/ NEXT Generation 27 / NEXT27.iso / pc / demos / emperor / dx3.exe / SDK / SAMPLES / IKLOWNS / INCLUDE / CGDEBUG.H next >
C/C++ Source or Header  |  1996-08-28  |  2KB  |  51 lines

  1. /*===========================================================================*\
  2. |
  3. |  File:        cgdebug.h
  4. |
  5. |  Description: 
  6. |       debugging macros 
  7. |       
  8. |-----------------------------------------------------------------------------
  9. |
  10. |  Copyright (C) 1995-1996 Microsoft Corporation.  All Rights Reserved.
  11. |
  12. |  Written by Moss Bay Engineering, Inc. under contract to Microsoft Corporation
  13. |
  14. \*===========================================================================*/
  15.  
  16. #ifndef CGDEBUG_H
  17. #define CGDEBUG_H
  18.  
  19. // NOTE: must define DEBUG to get any debug strings!
  20. #ifdef DEBUG
  21. #define DB_LOG(type, string) if (DB_TYPES & type) OutputDebugString(string);
  22. #else
  23. #define DB_LOG(type, string)
  24. #endif
  25.  
  26. // DB_TYPES is a bitmap of desired debug strings
  27. #define DB_INFO             0x01    // for non-error, non-time-critical information output
  28. #define DB_TIMECRIT_INFO    0x02    // for non-error, time-critical (e.g. IRQ handler) info
  29. #define DB_PROBLEM          0x04    // for non-time-critical problem report
  30. #define DB_TIMECRIT_PROBLEM 0x08    // for time-critical (e.g. IRQ handler) problem report
  31.  
  32. // default to no debug output if DB_TYPES not defined
  33. #ifndef DB_TYPES
  34. #define DB_TYPES 0
  35. #endif
  36.  
  37. #ifdef DEBUG
  38. #define DB_BREAK_IF(x)  if (x) DebugBreak();
  39. #define DB_BREAK()  DebugBreak();
  40.  
  41. #define DB_CHECK(x, string) if (x) DB_LOG(DB_PROBLEM, string);
  42. #else
  43. #define DB_BREAK_IF(x)
  44. #define DB_BREAK()
  45.  
  46. #define DB_CHECK(x, string)
  47. #endif
  48.  
  49.  
  50. #endif // CGDEBUG_H
  51.