ReXGlue SDK
Loading...
Searching...
No Matches
assert.h File Reference
#include <assert.h>
#include <cstdio>
#include <cstdlib>
#include <exception>
#include <string>
#include <utility>
#include <rex/platform.h>

Go to the source code of this file.

Namespaces

namespace  rex

Macros

#define REX_ASSERT(cond, ...)
#define REX_ASSERT_ALWAYS(...)
#define REX_UNHANDLED_CASE(var)

Detailed Description

License
BSD 3-Clause License See LICENSE file in the project root for full license text.
Remarks
Derived from Xenia's xenia/base/assert.h (Ben Vanik, 2014).

Macro Definition Documentation

◆ REX_ASSERT

#define REX_ASSERT ( cond,
... )
Value:
((cond) ? (void)0 \
: ::rex::detail::AssertFail(__FILE__, __LINE__, #cond, \
::rex::detail::AssertMessage(__VA_ARGS__)))

Checks a condition in Debug. Release does not evaluate the condition.

Parameters
...Optional message.
REX_ASSERT(count <= capacity, "ring overflow");
#define REX_ASSERT(cond,...)
Definition assert.h:84

◆ REX_ASSERT_ALWAYS

#define REX_ASSERT_ALWAYS ( ...)
Value:
::rex::detail::AssertFail(__FILE__, __LINE__, "unreachable", \
::rex::detail::AssertMessage(__VA_ARGS__))

Aborts in Debug on a path that must not run. Does nothing in Release.

Parameters
...Optional message.
REX_ASSERT_ALWAYS("unsupported packet");
#define REX_ASSERT_ALWAYS(...)
Definition assert.h:102

◆ REX_UNHANDLED_CASE

#define REX_UNHANDLED_CASE ( var)
Value:
::rex::detail::AssertFail(__FILE__, __LINE__, "unhandled case: " #var, "")

Aborts in Debug when a switch reaches a value it does not handle. Does nothing in Release.

default:
break;
#define REX_UNHANDLED_CASE(var)
Definition assert.h:119