More fixes for Assert.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-03-22 12:02:02 +01:00
parent 2d4cc2cd80
commit aa1b90554f
2 changed files with 13 additions and 8 deletions

View File

@@ -6,14 +6,12 @@
#ifndef NO_ASSERT
#define Assert(expr) \
{ \
if (!(expr)) { \
std::stringstream ss; \
ss << "ASSERTION FAILED: [" << __FILENAME__ << " (" << __LINE__ << ")] \""; \
ss << #expr << "\""; \
throw std::logic_error(ss.str()); \
} \
};
if (!(expr)) { \
std::stringstream ss; \
ss << "ASSERTION FAILED: [" << __FILENAME__ << " (" << __LINE__ << ")] \""; \
ss << #expr << "\""; \
throw std::logic_error(ss.str()); \
}
#else
// Assert is empty if NO_ASSERT is defined.
#define Assert(expr)