[*] Respect AU_NO_INC_ARG_EXPRESSIONS / AU_INC_ARG_EXPRESSIONS under SysPanics

This commit is contained in:
Reece Wilson 2024-03-10 10:12:09 +00:00
parent 99533c456d
commit 58e8209cff
2 changed files with 13 additions and 1 deletions

View File

@ -18,6 +18,15 @@
#endif
#endif
// AU_NO_INC_ARG_EXPRESSIONS / AU_INC_ARG_EXPRESSIONS is seemingly what the SysCheck's were looking for.
#if defined(AU_NO_INC_ARG_EXPRESSIONS) && !defined(AURORA_ASSERTIONS_NO_EXPRESSIONS)
#define AURORA_ASSERTIONS_NO_EXPRESSIONS
#endif
#if defined(AU_INC_ARG_EXPRESSIONS) && !defined(AURORA_ASSERTIONS_FORCE_EXPRESSIONS) && !defined(AURORA_ASSERTIONS_NO_EXPRESSIONS)
#define AURORA_ASSERTIONS_FORCE_EXPRESSIONS
#endif
#if defined(AURORA_ASSERTIONS_NO_EXPRESSIONS)
#define _AUKCON_STRINGIFY_X2(...)
#else

View File

@ -182,7 +182,7 @@ namespace Aurora::Debug
#define SysCheckNotNullMemory(x, ...) if (!(static_cast<bool>(x))) { SysPushErrorMemory(); return __VA_ARGS__; }
#endif
#if defined(AU_CFG_ID_INTERNAL) || defined(AU_CFG_ID_DEBUG) || defined(AU_INC_ARG_NAMES)
#if (defined(AU_CFG_ID_INTERNAL) || defined(AU_CFG_ID_DEBUG) || defined(AU_INC_ARG_EXPRESSIONS)) && !defined(AU_NO_INC_ARG_EXPRESSIONS)
#define SysCheckRetExpNotNull(x, ...) if (auto n = x) { return n; } else { SysPushErrorGeneric(#x " must not be null [return]"); return __VA_ARGS__; }
#define SysCheckRetExpNotNullMemory(x, ...) if (auto n = x) { return n; } else { SysPushErrorMemory(#x); return __VA_ARGS__; }
#else
@ -190,6 +190,9 @@ namespace Aurora::Debug
#define SysCheckRetExpNotNullMemory(x, ...) if (auto n = x) { return n; } else { SysPushErrorMemory(); return __VA_ARGS__; }
#endif
#define SysCheckNotNullNested(x, ...) if (!(static_cast<bool>(x))) { SysPushErrorNested(); return __VA_ARGS__; }
#define SysCheckRetExpNotNullNested(x, ...) if (auto n = x) { return n; } else { SysPushErrorNested(); return __VA_ARGS__; }
// edge case
#define SysPushErrorNested(...) Aurora::Debug::ErrorMakeNested(__VA_ARGS__);