Advertisement
Guest User

Untitled

a guest
Mar 30th, 2015
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. /* Assert macros */
  2. #ifdef _DEBUG
  3. // Assert ensures the data is valid only in debug mode
  4. #define ASSERTF(exp, msg, ...) if (!(exp)) { LogPrivate::Log::Error(">>> ASSERT FAILED <<<\nExpression: " #exp "\nMessage: " msg "\nFile: %s (%i)", __VA_ARGS__, __FILE__, __LINE__); __debugbreak(); }
  5. #define ASSERT(exp) if (!(exp)) { LogPrivate::Log::Error(">>> ASSERT FAILED <<<\nExpression: " #exp "\nFile: %s (%i)", __FILE__, __LINE__); __debugbreak(); }
  6. #else
  7. // Assert ensures the data is valid only in debug mode
  8. #define ASSERTF(exp, msg, ...) ;
  9. #define ASSERT(exp) ;
  10. #endif // _DEBUG
  11.  
  12. // Verify ensures that data is valid in any build
  13. #define VERIFYF(exp, msg, ...) if (!(exp)) { LogPrivate::Log::Error(">>> ASSERT FAILED <<<\nExpression: " #exp "\nMessage: " msg "\nFile: %s (%i)", __VA_ARGS__, __FILE__, __LINE__); __debugbreak(); }
  14. #define VERIFY(exp) if (!(exp)) { LogPrivate::Log::Error(">>> ASSERT FAILED <<<\nExpression: " #exp "\nFile: %s (%i)", __FILE__, __LINE__); __debugbreak(); }
  15.  
  16. // Enable code stub tracing will break point if it hits a stub
  17. #ifdef _DEBUG
  18. #define STUB_TRACE 0
  19. #else
  20. #define STUB_TRACE 0
  21. #endif
  22. #if STUB_TRACE
  23. #define STUB __debugbreak();
  24. #else
  25. #define STUB
  26. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement