Changed NDEBUG test so that it does not preclude using ETL_LOG_ERRORS

This commit is contained in:
John Wellbelove 2016-06-18 07:08:55 +01:00
parent 800b9b3555
commit b9e20437d8

View File

@ -102,11 +102,15 @@ namespace etl
#define ETL_ASSERT(b, e) {if (!(b)) {throw((e));}} // If the condition fails, throws an exception.
#endif
#else
#if defined(NDEBUG)
#define ETL_ASSERT(b, e) // Does nothing.
#else
#if defined(ETL_LOG_ERRORS)
#if defined(ETL_LOG_ERRORS)
#if defined(NDEBUG)
#define ETL_ASSERT(b, e) {etl::error_handler::error((e));} // If the condition fails, calls the error handler
#else
#define ETL_ASSERT(b, e) {etl::error_handler::error((e)); assert((b));} // If the condition fails, calls the error handler then asserts.
#endif
#else
#if defined(NDEBUG)
#define ETL_ASSERT(b, e) // Does nothing.
#else
#define ETL_ASSERT(b, e) assert((b)) // If the condition fails, asserts.
#endif