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.

48 lines
1.4 KiB

  1. // Copyright (c) 2000 Microsoft Corporation
  2. //
  3. // ASSERT macro
  4. //
  5. // 3 Mar 2000 sburns
  6. // to be #included from blcore.hpp
  7. // Using the CRT assert or _ASSERTE turned into a hassle, as the CRT has
  8. // it's own notions of debug building.
  9. #undef ASSERT
  10. #ifdef DBG
  11. #define ASSERT(expr) \
  12. { /* open scope */ \
  13. if (!(expr)) \
  14. { \
  15. if (Burnslib::FireAssertionFailure(__FILE__, __LINE__, #expr)) \
  16. { \
  17. DebugBreak(); \
  18. } \
  19. } \
  20. } /* close scope */ \
  21. #else
  22. #define ASSERT(expr) ((void)0)
  23. #endif
  24. namespace Burnslib
  25. {
  26. // Returns true to indicate that the user has requested to drop into
  27. // the debugger, false to ignore the assertion failure
  28. //
  29. // If the user chooses to abort the app, this function will call exit(3)
  30. // and not return.
  31. bool
  32. FireAssertionFailure(const char* file, int line, const char* expr);
  33. }