mirror of
https://github.com/Jous99/F4MP.git
synced 2026-01-13 00:20:54 +01:00
25 lines
727 B
C
25 lines
727 B
C
|
|
// Copyright (C) 2022 TiltedPhoques SRL.
|
||
|
|
// For licensing information see LICENSE at the root of this distribution.
|
||
|
|
#pragma once
|
||
|
|
|
||
|
|
#include <spdlog/spdlog.h>
|
||
|
|
|
||
|
|
namespace base
|
||
|
|
{
|
||
|
|
static void Assert(const char* apExpression, const char* apMessage)
|
||
|
|
{
|
||
|
|
spdlog::critical("Assertion failed ({}): {}", apExpression, apMessage);
|
||
|
|
|
||
|
|
#if defined(_WIN32)
|
||
|
|
if (IsDebuggerPresent())
|
||
|
|
__debugbreak();
|
||
|
|
#endif
|
||
|
|
}
|
||
|
|
} // namespace base
|
||
|
|
|
||
|
|
#define BASE_ASSERT(Expr, Msg, ...) \
|
||
|
|
if (!(Expr)) \
|
||
|
|
{ \
|
||
|
|
::base::Assert(#Expr, fmt::format(Msg, ##__VA_ARGS__).c_str()); \
|
||
|
|
}
|