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.

49 lines
726 B

  1. #ifndef _WSASSERT_
  2. #define _WSASSERT_
  3. //
  4. // Define an assert that actually works.
  5. //
  6. #if DBG
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10. VOID
  11. WsAssert(
  12. LPVOID FailedAssertion,
  13. LPVOID FileName,
  14. ULONG LineNumber
  15. );
  16. #ifdef __cplusplus
  17. }
  18. #endif
  19. #define WS_ASSERT(exp) if( !(exp) ) \
  20. WsAssert( #exp, __FILE__, __LINE__ ); \
  21. else
  22. #define WS_REQUIRE(exp) WS_ASSERT(exp)
  23. #else
  24. #define WS_ASSERT(exp)
  25. #define WS_REQUIRE(exp) ((VOID)(exp))
  26. #endif
  27. //
  28. // Map CRT assert to our manly assert.
  29. //
  30. #undef assert
  31. #define assert WS_ASSERT
  32. #endif // _WSASSERT_