CCF
Loading...
Searching...
No Matches
Macros
ccf_assert.h File Reference
#include "ccf/ds/logger.h"

Go to the source code of this file.

Macros

#define CCF_ASSERT_FMT_FAIL(...)    CCF_ASSERT(false, fmt::format(__VA_ARGS__).c_str())
 
#define CCF_ASSERT_FMT(expr, ...)    CCF_ASSERT(expr, fmt::format(__VA_ARGS__).c_str())
 
#define CCF_ASSERT(expr, msg)
 

Macro Definition Documentation

◆ CCF_ASSERT

#define CCF_ASSERT (   expr,
  msg 
)
Value:
do \
{ \
if ((expr) == 0) \
{ \
CCF_LOG_FMT(FAIL, "assert") \
("Assertion failed: {} {}", #expr, (msg)); \
throw std::logic_error(msg); \
} \
} while (0)

◆ CCF_ASSERT_FMT

#define CCF_ASSERT_FMT (   expr,
  ... 
)     CCF_ASSERT(expr, fmt::format(__VA_ARGS__).c_str())

◆ CCF_ASSERT_FMT_FAIL

#define CCF_ASSERT_FMT_FAIL (   ...)     CCF_ASSERT(false, fmt::format(__VA_ARGS__).c_str())