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.

56 lines
734 B

  1. /*
  2. * debbase.h - Base debug macros and their retail translations.
  3. */
  4. /* Macros
  5. *********/
  6. /* debug assertion macro */
  7. /*
  8. * ASSERT() may only be used as a statement, not as an expression.
  9. *
  10. * E.g.,
  11. *
  12. * ASSERT(pszRest);
  13. */
  14. #ifdef DEBUG
  15. #define ASSERT(exp) \
  16. if (exp) \
  17. ; \
  18. else \
  19. ERROR_OUT(("assertion failed '%s'", (PCSTR)#exp))
  20. #else
  21. #define ASSERT(exp)
  22. #endif /* DEBUG */
  23. /* debug evaluation macro */
  24. /*
  25. * EVAL() may only be used as a logical expression.
  26. *
  27. * E.g.,
  28. *
  29. * if (EVAL(exp))
  30. * bResult = TRUE;
  31. */
  32. #ifdef DEBUG
  33. #define EVAL(exp) \
  34. ((exp) || \
  35. (ERROR_OUT(("evaluation failed '%s'", (PCSTR)#exp)), 0))
  36. #else
  37. #define EVAL(exp) \
  38. ((exp) != 0)
  39. #endif /* DEBUG */