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

  1. /*==========================================================================
  2.  *
  3.  *  Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
  4.  *
  5.  *  File:        debug.h
  6.  *  Content:    debug header
  7.  *
  8.  ***************************************************************************/
  9. #ifndef __DEBUG_INCLUDED__
  10. #define __DEBUG_INCLUDED__
  11. #ifdef __cplusplus
  12. extern "C"
  13. {
  14. #endif
  15.  
  16. //
  17. //
  18. //
  19. //
  20. #ifdef DEBUG
  21.     #define DEBUG_SECTION       "Debug"     // section name for 
  22.     #define DEBUG_MODULE_NAME   "DSSTREAM"  // key name and prefix for output
  23.     #define DEBUG_MAX_LINE_LEN  255         // max line length (bytes!)
  24. #endif
  25.  
  26.  
  27. //
  28. //  based code makes since only in win 16 (to try and keep stuff out of
  29. //  [fixed] data segments, etc)...
  30. //
  31. #ifndef BCODE
  32. #ifdef _WIN32
  33.     #define BCODE
  34. #else
  35.     #define BCODE           _based(_segname("_CODE"))
  36. #endif
  37. #endif
  38.  
  39.  
  40.  
  41.  
  42. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  43. //
  44. //
  45. //
  46. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  47.  
  48. #ifdef DEBUG
  49.     BOOL WINAPI DbgEnable(BOOL fEnable);
  50.     UINT WINAPI DbgGetLevel(void);
  51.     UINT WINAPI DbgSetLevel(UINT uLevel);
  52.     UINT WINAPI DbgInitialize(BOOL fEnable);
  53.     void WINAPI _Assert( char * szFile, int iLine );
  54.  
  55.     void FAR CDECL dprintf(UINT uDbgLevel, LPSTR szFmt, ...);
  56.  
  57.     #define D(x)        {x;}
  58.     #define DPF         dprintf
  59.     #define DPI(sz)     {static char BCODE ach[] = sz; OutputDebugStr(ach);}
  60.     #define ASSERT(x)   if( !(x) )  _Assert( __FILE__, __LINE__)
  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.     #define ASSERT(x)
  75. #endif
  76.  
  77. #ifdef __cplusplus
  78. }
  79. #endif
  80. #endif  // __DEBUG_INCLUDED__
  81.