Source code of Windows XP (NT5)
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.

74 lines
1.2 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. debug.h
  5. Abstract:
  6. SIS Groveler debug print include file
  7. Authors:
  8. John Douceur, 1998
  9. Cedric Krumbein, 1998
  10. Environment:
  11. User Mode
  12. Revision History:
  13. --*/
  14. #ifndef _INC_DEBUG
  15. #define _INC_DEBUG
  16. #undef ASSERT
  17. #if DBG
  18. INT __cdecl PrintDebugMsg(
  19. TCHAR *format,
  20. ...);
  21. #define PRINT_DEBUG_MSG(args) PrintDebugMsg ## args
  22. #define ASSERT(cond) \
  23. ((!(cond)) ? \
  24. (PrintDebugMsg(_T("ASSERT FAILED (%s:%d) %s\n"), \
  25. _T(__FILE__), __LINE__, _T(#cond)), \
  26. DbgBreakPoint()) : \
  27. ((void)0))
  28. #define ASSERT_ERROR(cond) \
  29. ((!(cond)) ? \
  30. (PrintDebugMsg(_T("ASSERT FAILED (%s:%d) %s: %lu\n"), \
  31. _T(__FILE__), __LINE__, _T(#cond), GetLastError()), \
  32. DbgBreakPoint()) : \
  33. ((void)0))
  34. #define ASSERT_PRINTF(cond, args) \
  35. ((!(cond)) ? \
  36. (PrintDebugMsg(_T("ASSERT FAILED (%s:%d) %s "), \
  37. _T(__FILE__), __LINE__, _T(#cond)), \
  38. PrintDebugMsg ## args , \
  39. DbgBreakPoint()) : \
  40. ((void)0))
  41. #else // DBG
  42. #define PRINT_DEBUG_MSG(args)
  43. #define ASSERT(cond) ((void)0)
  44. #define ASSERT_ERROR(cond) ((void)0)
  45. #define ASSERT_PRINTF(cond, args) ((void)0)
  46. #endif
  47. #endif /* _INC_DEBUG */