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);
39#if SC_PLATFORM_WINDOWS
40#define WFILE WIDEN(__FILE__)
46#define SC_ASSERT_RELEASE(e) \
48 SC_LANGUAGE_UNLIKELY \
50 SC::Assert::printBacktrace(#e, WFILE, __func__, __LINE__); \
51 SC_COMPILER_DEBUG_BREAK; \
52 SC::Assert::exit(-1); \
58#if SC_CONFIGURATION_DEBUG
59#define SC_ASSERT_DEBUG(e) SC_ASSERT_RELEASE(e)
61#define SC_ASSERT_DEBUG(e) (void)0
65#define SC_TRUST_RESULT(expression) SC_ASSERT_RELEASE(expression)
#define SC_COMPILER_FORCE_INLINE
Macro for forcing inline functions.
Definition Compiler.h:46
char native_char_t
The native char for the platform (wchar_t (4 bytes) on Windows, char (1 byte) everywhere else )
Definition PrimitiveTypes.h:34
Functions and macros to assert, exit() or abort() and capture backtraces.
Definition Assert.h:17
static void exit(int code)
Exits current process with the given code.
static void printBacktrace(const char *expression, const native_char_t *filename, const char *function, int line)
Prints an assertion to standard output.