F4MP/tiltedcode/Code/base/Check.h
Jous99 37b16f1547 code upload
codigo original de f4mp y tilted para referencias
2026-01-06 18:45:00 +01:00

24 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()); \
}