4#include "../Foundation/Compiler.h"
5#include "../Foundation/LibC.h"
6#include "../Foundation/Platform.h"
10struct SC_COMPILER_EXPORT Assert;
23 __builtin_unreachable();
27 [[noreturn]]
static void exit(
int code);
30 static void printBacktrace(
const char* expression,
const char* filename,
const char* function,
int line);
42#define SC_ASSERT_RELEASE(e) \
44 SC_LANGUAGE_UNLIKELY \
46 SC::Assert::printBacktrace(#e, __FILE__, __func__, __LINE__); \
47 SC_COMPILER_DEBUG_BREAK; \
48 SC::Assert::exit(-1); \
54#if SC_CONFIGURATION_DEBUG
55#define SC_ASSERT_DEBUG(e) SC_ASSERT_RELEASE(e)
57#define SC_ASSERT_DEBUG(e) (void)0
61#define SC_TRUST_RESULT(expression) SC_ASSERT_RELEASE(expression)
#define SC_COMPILER_FORCE_INLINE
Macro for forcing inline functions.
Definition Compiler.h:46
Functions and macros to assert, exit() or abort() and capture backtraces.
Definition Assert.h:17
static void printBacktrace(const char *expression, const char *filename, const char *function, int line)
Prints an assertion to standard output.
static void exit(int code)
Exits current process with the given code.