CARB_CHECK

Defined in carb/Defines.h

CARB_CHECK(cond, ...)

Optionally performs a runtime check assertion, by default for both debug and release builds.

The implementation can be overridden on the command line, or by defining to a different implementation before including this file.

When cond produces a false result, the failure is reported to the g_carbAssert assertion handler, or if that global variable is nullptr, calls carb::assertHandlerFallback(). Depending on the result from that function call, execution is allowed to continue, or CARB_BREAK_POINT() is invoked to notify the debugger.

Note

The CARB_CHECK_ENABLED define can be used to determine if runtime check asserts are enabled, or to cause them to be enabled or disabled by defining it before including this file.

Warning

The cond should have no side effects! Asserts can be disabled which will cause cond to not be evaluated.

Parameters
  • cond – A condition that is evaluated for a boolean result. If the condition produces false, the assert handler is notified.

  • ... – An optional printf-style format string and variadic parameters.