mirror of
https://github.com/ModOrganizer2/modorganizer-uibase.git
synced 2026-07-27 14:03:49 -07:00
* Add proper CMake packaging for UIBase. * Add alias mo2::uibase target for uibase. * Add a few string methods to remove boost dependencies.
27 lines
521 B
C++
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
|