Donner 0.5.1
Embeddable browser-grade SVG2 engine
Loading...
Searching...
No Matches
Utils.h File Reference
#include <cassert>
#include <cstdio>
Include dependency graph for Utils.h:
This graph shows which files directly or indirectly include this file:

Macros

#define UTILS_PREDICT_TRUE(x)
 A hint to the compiler that the expression x is likely to evaluate to true.
#define UTILS_PREDICT_FALSE(x)
 A hint to the compiler that the expression x is likely to evaluate to false.
#define UTILS_UNREACHABLE()
 A hint to the compiler that the code following this macro is unreachable.
#define UTILS_RELEASE_ASSERT(x)
 An assert that evaluates on both release and debug builds.
#define UTILS_RELEASE_ASSERT_MSG(x, msg)
 An assert that evaluates on both release and debug builds and errors with the provided msg.
#define UTILS_UNUSED(x)
 Suppresses unused-variable warnings for x.
#define UTILS_EXCEPTIONS_ENABLED()
 Returns true if exceptions are enabled, false otherwise.

Macro Definition Documentation

◆ UTILS_EXCEPTIONS_ENABLED

#define UTILS_EXCEPTIONS_ENABLED ( )
Value:
false

Returns true if exceptions are enabled, false otherwise.

◆ UTILS_PREDICT_FALSE

#define UTILS_PREDICT_FALSE ( x)
Value:
(x)

A hint to the compiler that the expression x is likely to evaluate to false.

Parameters
xThe expression to evaluate.

◆ UTILS_PREDICT_TRUE

#define UTILS_PREDICT_TRUE ( x)
Value:
(x)

A hint to the compiler that the expression x is likely to evaluate to true.

Parameters
xThe expression to evaluate.

◆ UTILS_RELEASE_ASSERT

#define UTILS_RELEASE_ASSERT ( x)
Value:
assert(x)

An assert that evaluates on both release and debug builds.

Asserts that x is true in release builds, stopping execution with an abort. On debug builds, falls back to an assert.

Parameters
xThe expression to evaluate.

◆ UTILS_RELEASE_ASSERT_MSG

#define UTILS_RELEASE_ASSERT_MSG ( x,
msg )
Value:
assert((x) && (msg))

An assert that evaluates on both release and debug builds and errors with the provided msg.

Asserts that x is true in release builds, stopping execution with an abort. On debug builds, falls back to an assert.

Parameters
xThe expression to evaluate.
msgA message to print if the assertion fails.

◆ UTILS_UNUSED

#define UTILS_UNUSED ( x)
Value:
(void)(x)

Suppresses unused-variable warnings for x.

Parameters
xThe variable to mark as intentionally unused.