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.

40 lines
1.1 KiB

  1. //+----------------------------------------------------------------------------
  2. // File: debug.hxx
  3. //
  4. // Synopsis: Debug macros, classes, and helpers
  5. //
  6. //-----------------------------------------------------------------------------
  7. #ifndef _DEBUG_HXX
  8. #define _DEBUG_HXX
  9. // Macros ---------------------------------------------------------------------
  10. // Debug macros/routines
  11. #ifdef _DEBUG
  12. #define Assert(x) { \
  13. if (!(x) && (1 == _CrtDbgReport(_CRT_ASSERT, __FILE__, __LINE__, NULL, #x))) \
  14. _CrtDbgBreak(); \
  15. }
  16. #define AssertF(x) { \
  17. if (1 == _CrtDbgReport(_CRT_ASSERT, __FILE__, __LINE__, NULL, #x)) \
  18. _CrtDbgBreak(); \
  19. }
  20. #define Implies(x,y) Assert((!x)||(y))
  21. #define Verify(x) Assert(x)
  22. #define Debug(x) x
  23. // Non-Debug macros/routines
  24. #else
  25. #define Assert(x)
  26. #define AssertF(x)
  27. #define Implies(x,y)
  28. #define Verify(x) x
  29. #define Debug(x)
  30. #endif
  31. #endif // _DEBUG_HXX