Saga
Saga Game Engine
Loading...
Searching...
No Matches
asserts.h File Reference
#include "../defines.h"
Include dependency graph for asserts.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  Saga
 

Macros

#define SAGA_ASSERTIONS_ENABLED
 
#define debugBreak()   __builtin_trap()
 
#define SASSERT(expr)
 Assert an expression evaluates to true. If it does not, log a FATAL level message and stop the execution of the program.
 
#define SASSERT_MESSAGE(expr, message, ...)
 Assert an expression evaluates to true. If it does not, log a FATAL level message and stop the execution of the program.
 
#define SASSERT_DEBUG(expr)
 
#define SASSERT_DEBUG_MESSAGE(expr, message)
 

Functions

void Saga::reportAssertionFailed (const char *expression, const char *message, const char *file, int line,...)
 Output a message signaling that an assertion has failed. This message is of the form: Assertion Failure: #expression, message: message, in file: file, line: line
 

Macro Definition Documentation

◆ debugBreak

#define debugBreak ( )    __builtin_trap()

◆ SAGA_ASSERTIONS_ENABLED

#define SAGA_ASSERTIONS_ENABLED

◆ SASSERT

#define SASSERT (   expr)
Value:
{ \
if (!(expr)) { \
reportAssertionFailed(#expr, "", __FILE__, __LINE__); \
debugBreak(); \
} \
}

Assert an expression evaluates to true. If it does not, log a FATAL level message and stop the execution of the program.

Parameters
expran expression that evaluates to a boolean.

◆ SASSERT_DEBUG

#define SASSERT_DEBUG (   expr)

◆ SASSERT_DEBUG_MESSAGE

#define SASSERT_DEBUG_MESSAGE (   expr,
  message 
)

◆ SASSERT_MESSAGE

#define SASSERT_MESSAGE (   expr,
  message,
  ... 
)
Value:
{ \
if (!(expr)) { \
reportAssertionFailed(#expr, message, __FILE__, __LINE__, ##__VA_ARGS__); \
debugBreak(); \
} \
}

Assert an expression evaluates to true. If it does not, log a FATAL level message and stop the execution of the program.

Parameters
expran expression that evaluates to a boolean.
messagea message that will be displayed when an error happens.