When exceptions are disabled, only print the error message when defined(TSL_DEBUG) instead of !defined(NDEBUG)

This commit is contained in:
Tessil 2022-04-30 09:47:51 +01:00
parent 59a3b7d26d
commit 37e94dcdb2

View File

@ -51,15 +51,15 @@
#define TSL_RH_THROW_OR_TERMINATE(ex, msg) throw ex(msg)
#else
#define TSL_RH_NO_EXCEPTIONS
#ifdef NDEBUG
#define TSL_RH_THROW_OR_TERMINATE(ex, msg) std::terminate()
#else
#ifdef TSL_DEBUG
#include <iostream>
#define TSL_RH_THROW_OR_TERMINATE(ex, msg) \
do { \
std::cerr << msg << std::endl; \
std::terminate(); \
} while (0)
#else
#define TSL_RH_THROW_OR_TERMINATE(ex, msg) std::terminate()
#endif
#endif