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.

36 lines
967 B

  1. #ifndef _MYASSERT_H_
  2. #define _MYASSERT_H_
  3. #ifdef assert
  4. #error("Can't use two assert systems")
  5. #endif // assert
  6. #ifdef DEBUG
  7. extern const TCHAR SzNull[];
  8. VOID DigSigAssertFn(LPCTSTR, LPCTSTR, int, LPCTSTR);
  9. #define SZASSERT
  10. #define Assert(condition) \
  11. if (!(condition)) { \
  12. static const char SZASSERT szExpr[] = #condition; \
  13. static const char SZASSERT szFile[] = __FILE__; \
  14. DigSigAssertFn(szExpr, SzNull, __LINE__, szFile); \
  15. }
  16. #define AssertSz(condition, szInfo) \
  17. if (!(condition)) { \
  18. static const char SZASSERT szExpr[] = #condition; \
  19. static const char SZASSERT szFile[] = __FILE__; \
  20. DigSigAssertFn(szExpr, szInfo, __LINE__, szFile); \
  21. }
  22. #else // !DEBUG
  23. #define Assert(condition)
  24. #define AssertSz(condition, szInfo)
  25. #endif // DEBUG
  26. #endif // _MYASSERT_H_