14#if defined(JPH_DEBUG) && !defined(JPH_ENABLE_ASSERTS)
15 #define JPH_ENABLE_ASSERTS
18#ifdef JPH_ENABLE_ASSERTS
20 using AssertFailedFunction = bool(*)(
const char *inExpression,
const char *inMessage,
const char *inFile,
uint inLine);
21 JPH_EXPORT extern AssertFailedFunction AssertFailed;
24 struct AssertLastParam { };
25 inline bool AssertFailedParamHelper(
const char *inExpression,
const char *inFile,
uint inLine, AssertLastParam) {
return AssertFailed(inExpression,
nullptr, inFile, inLine); }
26 inline bool AssertFailedParamHelper(
const char *inExpression,
const char *inFile,
uint inLine,
const char *inMessage, AssertLastParam) {
return AssertFailed(inExpression, inMessage, inFile, inLine); }
29 #define JPH_ASSERT(inExpression, ...) do { if (!(inExpression) && AssertFailedParamHelper(#inExpression, __FILE__, JPH::uint(__LINE__), ##__VA_ARGS__, JPH::AssertLastParam())) JPH_BREAKPOINT; } while (false)
31 #define JPH_IF_ENABLE_ASSERTS(...) __VA_ARGS__
33 #define JPH_ASSERT(...) ((void)0)
35 #define JPH_IF_ENABLE_ASSERTS(...)
#define JPH_EXPORT
Definition Core.h:236
unsigned int uint
Definition Core.h:453
#define JPH_NAMESPACE_END
Definition Core.h:379
#define JPH_NAMESPACE_BEGIN
Definition Core.h:373
void(*)(const char *inFMT,...) TraceFunction
Trace function, needs to be overridden by application. This should output a line of text to the log /...
Definition IssueReporting.h:10
JPH_EXPORT TraceFunction Trace
Definition IssueReporting.cpp:18