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.

41 lines
992 B

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1998
  6. //
  7. // File: dbg.h
  8. //
  9. //--------------------------------------------------------------------------
  10. /////////////////////////////////////////////////////////////////////
  11. // debug helpers
  12. #if defined (DBG)
  13. #undef TRACE
  14. void DSATrace(LPCWSTR, ...);
  15. #define TRACE DSATrace
  16. #undef ASSERT
  17. #undef VERIFY
  18. #undef THIS_FILE
  19. #define THIS_FILE __FILE__
  20. BOOL DSAAssertFailedLine(LPCSTR lpszFileName, int nLine);
  21. #define ASSERT(f) \
  22. do \
  23. { \
  24. BOOL bLame = (f && L"hack so that prefast doesn't bark"); \
  25. if (!(bLame) && DSAAssertFailedLine(THIS_FILE, __LINE__)) \
  26. ::DebugBreak(); \
  27. } while (0) \
  28. #define VERIFY(f) ASSERT(f)
  29. #else
  30. #undef ASSERT
  31. #define ASSERT
  32. #define TRACE
  33. #define VERIFY(f) f
  34. #endif