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.

56 lines
1.6 KiB

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Copyright (C) 1994, Microsoft Corporation. All Rights Reserved.
  4. //
  5. // File: Debug.h
  6. //
  7. // History: 22-May-95 PatHal Created.
  8. //
  9. //---------------------------------------------------------------------------
  10. #ifndef _DEBUG_
  11. #define _DEBUG_
  12. #ifdef _DEBUG
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. // in NLGlib.h
  17. // extern void DebugAssert(LPCTSTR, LPCTSTR, UINT);
  18. // extern void SetAssertOptions(DWORD);
  19. //
  20. // Optional assert behavior
  21. #define AssertOptionWriteToFile 0x01
  22. #define AssertOptionShowAlert 0x02
  23. // Continue and exit are mutually exclusive
  24. #define AssertOptionContinue 0x00
  25. #define AssertOptionExit 0x04
  26. #define AssertOptionCallDebugger 0x08
  27. #define AssertOptionUseVCAssert 0x10
  28. #define AssertDefaultBehavior (AssertOptionUseVCAssert)
  29. #define bAssertWriteToFile() ((fAssertFlags & AssertOptionWriteToFile) != 0)
  30. #define bAssertShowAlert() ((fAssertFlags & AssertOptionShowAlert) != 0)
  31. #define bAssertExit() ((fAssertFlags & AssertOptionExit) != 0)
  32. #define bAssertCallDebugger() ((fAssertFlags & AssertOptionCallDebugger) != 0)
  33. #define bAssertUseVCAssert() ((fAssertFlags & AssertOptionUseVCAssert) != 0)
  34. #define Assert(a) { if (!(a)) DebugAssert((LPCTSTR)L#a, TEXT(__FILE__), __LINE__); }
  35. #define AssertSz(a,t) { if (!(a)) DebugAssert((LPCTSTR)t, TEXT(__FILE__), __LINE__); }
  36. #ifdef __cplusplus
  37. }
  38. #endif
  39. #else // _DEBUG
  40. #define Assert(a)
  41. #define AssertSz(a,t)
  42. #endif // _DEBUG
  43. #endif // _DEBUG_