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

  1. /*==========================================================================
  2.  *
  3.  *  Copyright (C) 1995-1996 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. LPSTR TranslateDSError( HRESULT );
  17.  
  18. //
  19. //
  20. //
  21. //
  22. #ifdef DEBUG
  23.     #define DEBUG_SECTION       "Debug"     // section name for 
  24.     #define DEBUG_MODULE_NAME   "DSSHOW3D"    // key name and prefix for output
  25.     #define DEBUG_MAX_LINE_LEN  255         // max line length (bytes!)
  26. #endif
  27.  
  28.  
  29. //
  30. //  based code makes since only in win 16 (to try and keep stuff out of
  31. //  [fixed] data segments, etc)...
  32. //
  33. #ifndef BCODE
  34. #ifdef _WIN32
  35.     #define BCODE
  36. #else
  37.     #define BCODE           _based(_segname("_CODE"))
  38. #endif
  39. #endif
  40.  
  41.  
  42.  
  43.  
  44. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  45. //
  46. //
  47. //
  48. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  49.  
  50. #if defined(DEBUG) || defined(_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.     void WINAPI _Assert( char * szFile, int iLine );
  56.  
  57.     void FAR CDECL dprintf(UINT uDbgLevel, LPSTR szFmt, ...);
  58.  
  59.     #define D(x)        {x;}
  60.     #define DPF         dprintf
  61.     #define DPI(sz)     {static char BCODE ach[] = sz; OutputDebugStr(ach);}
  62.     #define ASSERT(x)   if( !(x) )  _Assert( __FILE__, __LINE__)
  63. #else
  64.     #define DbgEnable(x)        FALSE
  65.     #define DbgGetLevel()       0
  66.     #define DbgSetLevel(x)      0
  67.     #define DbgInitialize(x)    0
  68.  
  69.     #ifdef _MSC_VER
  70.     #pragma warning(disable:4002)
  71.     #endif
  72.  
  73.     #define D(x)
  74.     #define DPF()
  75.     #define DPI(sz)
  76.     #define ASSERT(x)
  77. #endif
  78.  
  79. #if defined(DEBUG) || defined(_DEBUG)
  80. #define ASSERT_HWND( h )    ASSERT( IsWindow((h)) )
  81. #else
  82. #define ASSERT_HWND( h )    ASSERT( NULL != (h) )
  83. #endif
  84.  
  85. #ifdef __cplusplus
  86. }
  87. #endif
  88. #endif  // __DEBUG_INCLUDED__
  89.