9#include <userver/utils/impl/source_location.hpp>
11USERVER_NAMESPACE_BEGIN
17[[noreturn]]
void UASSERT_failed(
18 std::string_view expr,
25[[noreturn]]
void LogAndThrowInvariantError(
26 std::string_view condition,
27 std::string_view message,
28 utils::impl::SourceLocation source_location
32inline constexpr bool kEnableAssert =
false;
34inline constexpr bool kEnableAssert =
true;
37extern bool dump_stacktrace_on_assert_failure;
55#define UASSERT_MSG(expr, msg)
57 if (USERVER_NAMESPACE
::utils::impl::kEnableAssert) {
60 USERVER_NAMESPACE
::utils::impl::UASSERT_failed(#expr, __FILE__, __LINE__, __func__, msg);
55#define UASSERT_MSG(expr, msg) …
76#define UINVARIANT(condition, message)
80 if constexpr (USERVER_NAMESPACE
::utils::impl::kEnableAssert) {
81 USERVER_NAMESPACE
::utils::impl::UASSERT_failed(#condition, __FILE__, __LINE__, __func__, message);
83 USERVER_NAMESPACE
::utils::impl::LogAndThrowInvariantError(
84 #condition, message, USERVER_NAMESPACE
::utils::impl::SourceLocation::Current()
76#define UINVARIANT(condition, message) …