Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Assert macros */
- #ifdef _DEBUG
- // Assert ensures the data is valid only in debug mode
- #define ASSERTF(exp, msg, ...) if (!(exp)) { LogPrivate::Log::Error(">>> ASSERT FAILED <<<\nExpression: " #exp "\nMessage: " msg "\nFile: %s (%i)", __VA_ARGS__, __FILE__, __LINE__); __debugbreak(); }
- #define ASSERT(exp) if (!(exp)) { LogPrivate::Log::Error(">>> ASSERT FAILED <<<\nExpression: " #exp "\nFile: %s (%i)", __FILE__, __LINE__); __debugbreak(); }
- #else
- // Assert ensures the data is valid only in debug mode
- #define ASSERTF(exp, msg, ...) ;
- #define ASSERT(exp) ;
- #endif // _DEBUG
- // Verify ensures that data is valid in any build
- #define VERIFYF(exp, msg, ...) if (!(exp)) { LogPrivate::Log::Error(">>> ASSERT FAILED <<<\nExpression: " #exp "\nMessage: " msg "\nFile: %s (%i)", __VA_ARGS__, __FILE__, __LINE__); __debugbreak(); }
- #define VERIFY(exp) if (!(exp)) { LogPrivate::Log::Error(">>> ASSERT FAILED <<<\nExpression: " #exp "\nFile: %s (%i)", __FILE__, __LINE__); __debugbreak(); }
- // Enable code stub tracing will break point if it hits a stub
- #ifdef _DEBUG
- #define STUB_TRACE 0
- #else
- #define STUB_TRACE 0
- #endif
- #if STUB_TRACE
- #define STUB __debugbreak();
- #else
- #define STUB
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement