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.

51 lines
1.1 KiB

  1. #ifndef __ASSERT_H__
  2. #define __ASSERT_H__
  3. /* Routines for debugging and error messages. */
  4. #ifdef DEBUG
  5. #define VERIFY(f) {if(!(f)) AssertFn(szError, szFileAssert,__LINE__);}
  6. #else
  7. #define VERIFY(f)
  8. #endif
  9. #ifdef VxD
  10. #define AssertFn IFSMgr_AssertFailed
  11. #define PrintFn IFSMgr_Printf
  12. #else
  13. #define AssertFn AssertFn
  14. #define PrintFn PrintFn
  15. #endif
  16. #ifdef DEBUG
  17. #define AssertData static char szFileAssert[] = __FILE__;
  18. #define AssertError static char szError[] = "Error";
  19. #define Assert(f) do {if (!(f)) AssertFn(szError, szFileAssert, __LINE__);} while(0)
  20. #define AssertSz(f, sz) do {if (!(f)) AssertFn(sz, szFileAssert, __LINE__);} while(0)
  21. #define DEBUG_PRINT(_x_) PrintFn _x_
  22. #else
  23. #define Assert(f)
  24. #define AssertData
  25. #define AssertError
  26. #define AssertSz(f, sz)
  27. #define DEBUG_PRINT(_X_)
  28. #endif
  29. #ifdef VxD
  30. void IFSMgr_AssertFailed(PSZ pMsg, PSZ pFile, unsigned long uLine);
  31. void IFSMgr_Printf(PSZ pFmt, ...);
  32. #else
  33. VOID __cdecl AssertFn(LPSTR lpMsg, LPSTR lpFile, ULONG uLine);
  34. VOID __cdecl PrintFn(LPSTR lpFmt, ...);
  35. #endif
  36. #endif