Files
Mikaël Capelle 96a2f3aeb8 Move to VCPKG (#155)
* Add proper CMake packaging for UIBase.
* Add alias mo2::uibase target for uibase.
* Add a few string methods to remove boost dependencies.
2025-05-29 10:56:10 +02:00

27 lines
521 B
C++

#ifndef UIBASE_MOASSERT_INCLUDED
#define UIBASE_MOASSERT_INCLUDED
#include "log.h"
namespace MOBase
{
template <class T>
inline void MOAssert(T&& t, const char* exp, const char* file, int line,
const char* func)
{
if (!t) {
log::error("assertion failed: {}:{} {}: '{}'", file, line, func, exp);
if (IsDebuggerPresent()) {
DebugBreak();
}
}
}
} // namespace MOBase
#define MO_ASSERT(v) MOAssert(v, #v, __FILE__, __LINE__, __FUNCSIG__)
#endif // UIBASE_MOASSERT_INCLUDED