Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

127 lines
2.8 KiB

  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-1996 Microsoft Corporation. All Rights Reserved.
  9. //
  10. //--------------------------------------------------------------------------;
  11. //
  12. // debug.h
  13. //
  14. // Description:
  15. //
  16. //
  17. //
  18. //==========================================================================;
  19. #ifndef _INC_DEBUG
  20. #define _INC_DEBUG
  21. #ifdef __cplusplus
  22. extern "C"
  23. {
  24. #endif
  25. //
  26. // What stuff should we include?
  27. //
  28. #ifdef DEBUG
  29. #define USEDPF
  30. #define USERPF
  31. #define USEASSERT
  32. #endif
  33. #ifdef RDEBUG
  34. #define USERPF
  35. #endif
  36. //
  37. //
  38. //
  39. //
  40. #if defined(USEDPF) || defined(USERPF)
  41. #define DEBUG_SECTION "Debug" // section name for
  42. // key name and prefix for output
  43. #ifdef DDKAPP
  44. #define DEBUG_MODULE_NAME "DIMAPCFG"
  45. #else
  46. #define DEBUG_MODULE_NAME "DIMAPTST"
  47. #endif
  48. #define DEBUG_MAX_LINE_LEN 255 // max line length (bytes!)
  49. #endif
  50. //
  51. // based code makes since only in win 16 (to try and keep stuff out of
  52. // [fixed] data segments, etc)...
  53. //
  54. #ifndef BCODE
  55. #ifdef _WIN32
  56. #define BCODE
  57. #else
  58. #define BCODE _based(_segname("_CODE"))
  59. #endif
  60. #endif
  61. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  62. //
  63. //
  64. //
  65. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  66. #ifdef USEASSERT
  67. void WINAPI _Assert( char * szFile, int iLine, char * szExpression );
  68. #define ASSERT(x) if( !(x) ) _Assert( __FILE__, __LINE__, #x )
  69. #else
  70. #define ASSERT(x)
  71. #endif
  72. #ifdef USERPF
  73. void CDECL rprintf( LPSTR szFmt, ...);
  74. void FAR CDECL DbgVPrintF( LPSTR szFormat, va_list va );
  75. #define RPF rprintf
  76. #else
  77. #define RPF()
  78. #ifdef _MSC_VER
  79. #pragma warning(disable:4002)
  80. #endif
  81. #endif
  82. #ifdef USEDPF
  83. BOOL WINAPI DbgEnable(BOOL fEnable);
  84. UINT WINAPI DbgGetLevel(void);
  85. UINT WINAPI DbgSetLevel(UINT uLevel);
  86. UINT WINAPI DbgInitialize(BOOL fEnable);
  87. void FAR CDECL dprintf(UINT uDbgLevel, LPSTR szFmt, ...);
  88. #define D(x) {x;}
  89. #define DPF dprintf
  90. #define DPI(sz) {static char BCODE ach[] = sz; OutputDebugStr(ach);}
  91. #else
  92. #define DbgEnable(x) FALSE
  93. #define DbgGetLevel() 0
  94. #define DbgSetLevel(x) 0
  95. #define DbgInitialize(x) 0
  96. #ifdef _MSC_VER
  97. #pragma warning(disable:4002)
  98. #endif
  99. #define D(x)
  100. #define DPF()
  101. #define DPI(sz)
  102. #endif
  103. #ifdef __cplusplus
  104. }
  105. #endif
  106. #endif // _INC_DEBUG