home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / graphics / audio / mixapp / debug.h < prev    next >
C/C++ Source or Header  |  1997-10-05  |  2KB  |  80 lines

  1. //==========================================================================;
  2. //
  3. //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  4. //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  5. //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  6. //  PURPOSE.
  7. //
  8. //  Copyright (C) 1992 - 1997 Microsoft Corporation.  All Rights Reserved.
  9. //
  10. //--------------------------------------------------------------------------;
  11. //
  12. //  debug.h
  13. //
  14. //  Description:
  15. //
  16. //
  17. //
  18. //==========================================================================;
  19.  
  20. #ifndef _INC_DEBUG
  21. #define _INC_DEBUG
  22. #ifdef __cplusplus
  23. extern "C"
  24. {
  25. #endif
  26.  
  27. //
  28. //
  29. //
  30. //
  31. #ifdef DEBUG
  32.     #define DEBUG_SECTION       "Debug"     // section name for
  33.     #define DEBUG_MODULE_NAME   "MIXAPP"    // key name and prefix for output
  34.     #define DEBUG_MAX_LINE_LEN  255         // max line length (bytes!)
  35. #endif
  36.  
  37.  
  38. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  39. //
  40. //
  41. //
  42. //  #pragma message(REMIND("this is a reminder"))
  43. //
  44. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  45.  
  46. #define DEBUG_QUOTE(x)      #x
  47. #define DEBUG_QQUOTE(y)     DEBUG_QUOTE(y)
  48. #define REMIND(sz)          __FILE__ "(" DEBUG_QQUOTE(__LINE__) ") : " sz
  49.  
  50. #ifdef DEBUG
  51.     BOOL WINAPI DbgEnable(BOOL fEnable);
  52.     UINT WINAPI DbgGetLevel(void);
  53.     UINT WINAPI DbgSetLevel(UINT uLevel);
  54.     UINT WINAPI DbgInitialize(BOOL fEnable);
  55.  
  56.     void FAR CDECL dprintf(UINT uDbgLevel, LPSTR szFmt, ...);
  57.  
  58.     #define D(x)        {x;}
  59.     #define DPF         dprintf
  60.     #define DPI(sz)     {static char ach[] = sz; OutputDebugStr(ach);}
  61. #else
  62.     #define DbgEnable(x)        FALSE
  63.     #define DbgGetLevel()       0
  64.     #define DbgSetLevel(x)      0
  65.     #define DbgInitialize(x)    0
  66.  
  67.     #ifdef _MSC_VER
  68.     #pragma warning(disable:4002)
  69.     #endif
  70.  
  71.     #define D(x)
  72.     #define DPF()
  73.     #define DPI(sz)
  74. #endif
  75.  
  76. #ifdef __cplusplus
  77. }
  78. #endif
  79. #endif  // _INC_DEBUG
  80.