Banjo API 0.0.1
C99 game development API
Loading...
Searching...
No Matches
assert.h File Reference
#include <banjo/api.h>
#include <banjo/log.h>
#include <stdlib.h>
Include dependency graph for assert.h:

Go to the source code of this file.

Macros

#define bj_assert(expr)

Detailed Description

Assertion facility for Banjo API.

Provides the bj_assert macro, similar to the C standard assert(), with behavior controlled by the build configuration.

  • In debug builds (BJ_BUILD_DEBUG), failed assertions log a fatal error and terminate the process with abort().
  • In release builds (BJ_BUILD_RELEASE), assertions are disabled and compile to a no-op.

Macro Definition Documentation

◆ bj_assert

#define bj_assert ( expr)
Value:
((void)0)

Runtime assertion macro.

Evaluates the given expression and verifies it is non-zero (true).

  • In debug builds, if the expression evaluates to false, a fatal log is emitted and the program is terminated with abort().
  • In release builds, the macro does nothing.
Parameters
exprExpression to check for truth.