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.

50 lines
1.5 KiB

  1. /* File: D:\WACKER\tdll\assert.h (Created: 30-Nov-1993)
  2. *
  3. * Copyright 1994 by Hilgraeve Inc. -- Monroe, MI
  4. * All rights reserved
  5. *
  6. * $Revision: 1 $
  7. * $Date: 10/05/98 12:40p $
  8. */
  9. /*
  10. This file is slated for destruction. Well not exactly. It will be
  11. renamed to something else (possibly debug.h). Anyways, here are
  12. some rules for the road. The nature of these functions are such that
  13. they go away in the production version. To "communicate" this idea
  14. to the casual reader, we are prefixing the name of the macro with
  15. Dbg to denote that this is a debug thingy. Assert will reamain assert
  16. since its meaning and intention are well known to C programmers. Also,
  17. make sure the function in assert.c compiles to an empty function in
  18. when built as a production version. Other functions in assert.c already
  19. do this do look to them for an example. - mrw
  20. */
  21. #if !defined(INCL_ASSERT)
  22. #define INCL_ASSERT
  23. void DoAssertDebug(TCHAR *file, int line);
  24. void __cdecl DoDbgOutStr(TCHAR *achFmt, ...);
  25. void DoShowLastError(const TCHAR *file, const int line);
  26. #if !defined(NDEBUG)
  27. #define assert(X) if (!(X)) DoAssertDebug(TEXT(__FILE__), __LINE__)
  28. #if defined(DEBUGSTR)
  29. #define DbgOutStr(A,B,C,D,E,F) DoDbgOutStr(A,B,C,D,E,F)
  30. #else
  31. #define DbgOutStr(A,B,C,D,E,F)
  32. #endif
  33. #define DbgShowLastError() DoShowLastError(TEXT(__FILE__), __LINE__)
  34. #else
  35. #define assert(X)
  36. #define DbgOutStr(A,B,C,D,E,F)
  37. #define DbgShowLastError()
  38. #endif
  39. #endif