Further fixes for Assert
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-03-22 11:52:08 +01:00
parent 07f215a4fa
commit 2d4cc2cd80
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
1 changed files with 2 additions and 6 deletions

View File

@ -1,5 +1,3 @@
#ifndef ARBUTILS_ASSERT_HPP
#define ARBUTILS_ASSERT_HPP
#include <sstream> #include <sstream>
#include <stdexcept> #include <stdexcept>
#include <string.h> #include <string.h>
@ -15,12 +13,10 @@
ss << #expr << "\""; \ ss << #expr << "\""; \
throw std::logic_error(ss.str()); \ throw std::logic_error(ss.str()); \
} \ } \
} };
#else #else
// Assert is empty if NO_ASSERT is defined. // Assert is empty if NO_ASSERT is defined.
#define Assert(expr) #define Assert(expr)
#endif #endif
#define AssertNotNull(value) Assert(value != nullptr) #define AssertNotNull(value) Assert(value != nullptr)
#endif