[+] SysCheckArgNotNull

[*] finally fix SysPushErrorSyntax
This commit is contained in:
Reece Wilson 2023-09-28 12:08:57 +01:00
parent c5ab03cbfc
commit 742c0495d8

View File

@ -163,6 +163,12 @@ namespace Aurora::Debug
#define SysPushErrorNet(...) SysPushErrorError(kFailureNet, ## __VA_ARGS__)
#define SysPushErrorMem(...) SysPushErrorError(kFailureMemory, ## __VA_ARGS__)
#if defined(AU_CFG_ID_INTERNAL) || defined(AU_CFG_ID_DEBUG) || defined(AU_INC_ARG_NAMES)
#define SysCheckArgNotNull(x, ...) if (!(static_cast<bool>(x))) { SysPushErrorArg(#x "must not be null"); return __VA_ARGS__; }
#else
#define SysCheckArgNotNull(x, ...) if (!(static_cast<bool>(x))) { SysPushErrorArg(); return __VA_ARGS__; }
#endif
// edge case
#define SysPushErrorNested(...) Aurora::Debug::ErrorMakeNested(__VA_ARGS__);
@ -192,7 +198,7 @@ namespace Aurora::Debug
#define SysPushErrorUnimplemented(...) SysPushErrorError(kFailureUnimplemented, ## __VA_ARGS__)
#define SysPushErrorSubmission(...) SysPushErrorError(kFailureSubmission, ## __VA_ARGS__)
#define SysPushErrorLockError(...) SysPushErrorError(kFailureLockError, ## __VA_ARGS__)
#define SysPushErrorSyntax(...) SysPushErrorError(kFailureSyntax, ## __VA_ARGS__)
#define SysPushErrorSyntax(...) SysPushErrorError(kFailureSyntaxError, ## __VA_ARGS__)
#define SysPushErrorNoAccess(...) SysPushErrorError(kFailureNoAccess, ## __VA_ARGS__)
#define SysPushErrorResourceMissing(...) SysPushErrorError(kFailureResourceMissing, ## __VA_ARGS__)
#define SysPushErrorResourceLocked(...) SysPushErrorError(kFailureResourceLocked, ## __VA_ARGS__)