diff --git a/Include/Aurora/Debug/SysAssertions.hpp b/Include/Aurora/Debug/SysAssertions.hpp index 6c282011..acd2e327 100644 --- a/Include/Aurora/Debug/SysAssertions.hpp +++ b/Include/Aurora/Debug/SysAssertions.hpp @@ -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 diff --git a/Include/Aurora/Debug/SysErrors.hpp b/Include/Aurora/Debug/SysErrors.hpp index da74f9c2..24066b85 100644 --- a/Include/Aurora/Debug/SysErrors.hpp +++ b/Include/Aurora/Debug/SysErrors.hpp @@ -182,7 +182,7 @@ namespace Aurora::Debug #define SysCheckNotNullMemory(x, ...) if (!(static_cast(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(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__);