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.

77 lines
2.1 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 - 1998 Microsoft Corporation. All Rights Reserved.
  9. //
  10. //==========================================================================;
  11. #ifndef __BDADEBUG_H
  12. #define __BDADEBUG_H
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif // __cplusplus
  16. //======================================================;
  17. // Interfaces provided by this file:
  18. //
  19. // All interfaces provided by this file only exist and generate
  20. // code when DEBUG is defined. No code or data are generated when
  21. // DEBUG is not defined.
  22. //
  23. // CDEBUG_BREAK()
  24. // Causes a trap #3, which hopefully will put you
  25. // in your debugger.
  26. //
  27. // MDASSERT(exp)
  28. // If <exp> evaluates to false, prints a failure message
  29. // and calls CDEBUG_BREAK()
  30. //
  31. // CdebugPrint(level, (printf_args));
  32. // If <level> is >= _CDebugLevel, then calls
  33. // DbgPrint(printf_args)
  34. //
  35. //======================================================;
  36. #define DEBUG_BREAK DbgBreakPoint()
  37. #ifdef DEBUG
  38. #define DEBUG_LEVEL DEBUGLVL_VERBOSE //DEBUGLVL_TERSE
  39. # if _X86_
  40. # define CDEBUG_BREAK() { __asm { int 3 }; }
  41. # else
  42. # define CDEBUG_BREAK() DbgBreakPoint()
  43. # endif
  44. extern char _CDebugAssertFail[];
  45. # define MDASSERT(exp) {\
  46. if ( !(exp) ) {\
  47. DbgPrint(_CDebugAssertFail, #exp, __FILE__, __LINE__); \
  48. CDEBUG_BREAK(); \
  49. }\
  50. }
  51. extern enum STREAM_DEBUG_LEVEL _CDebugLevel;
  52. # define CDebugPrint(level, args) { if (level <= _CDebugLevel) DbgPrint args; }
  53. #else /*DEBUG*/
  54. # define CDEBUG_BREAK()
  55. # define MDASSERT(exp)
  56. # define CDebugPrint(level, args)
  57. #endif /*DEBUG*/
  58. #ifdef __cplusplus
  59. }
  60. #endif // __cplusplus
  61. #endif // #ifndef __BDADEBUG_H