1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 08:47:17 +01:00

Update SqBase.hpp

This commit is contained in:
Sandu Liviu Catalin 2021-08-18 21:36:16 +03:00
parent cb359ed61e
commit 181b0f4377

View File

@ -506,6 +506,26 @@ enum EntityType
#define SQMOD_NODISCARD #define SQMOD_NODISCARD
#endif #endif
/* ------------------------------------------------------------------------------------------------
* DEBUG SELECTION
*/
#ifdef _DEBUG
#define SQMOD_DEBUG_ONLY(X) X
#define SQMOD_EXCEPT_DEBUG(X)
#define SQMOD_RELEASE_ONLY(X)
#define SQMOD_EXCEPT_RELEASE(X) X
#define SQMOD_RTFMT(X) fmt::runtime(X)
#else
#define SQMOD_DEBUG_ONLY(X)
#define SQMOD_EXCEPT_DEBUG(X) X
#define SQMOD_RELEASE_ONLY(X) X
#define SQMOD_EXCEPT_RELEASE(X)
#define SQMOD_RTFMT(X) X
#endif
#define SQMOD_DEBUG_OR(D, R) SQMOD_DEBUG_ONLY(D) SQMOD_EXCEPT_DEBUG(R)
#define SQMOD_RELEASE_OR(R, D) SQMOD_RELEASE_ONLY(R) SQMOD_EXCEPT_RELEASE(D)
/* ------------------------------------------------------------------------------------------------ /* ------------------------------------------------------------------------------------------------
* LOGGING LOCATION * LOGGING LOCATION
*/ */
@ -525,7 +545,7 @@ enum EntityType
#if defined(_DEBUG) || defined(SQMOD_EXCEPTLOC) #if defined(_DEBUG) || defined(SQMOD_EXCEPTLOC)
#define STHROW(e, m, ...) throw e(m " =>[" __FILE__ ":" SQMOD_STRINGIZEWRAP(__LINE__) "] ", ##__VA_ARGS__) #define STHROW(e, m, ...) throw e(m " =>[" __FILE__ ":" SQMOD_STRINGIZEWRAP(__LINE__) "] ", ##__VA_ARGS__)
#define STHROWF(m, ...) SqThrowF(m " =>[" __FILE__ ":" SQMOD_STRINGIZEWRAP(__LINE__) "] ", ##__VA_ARGS__) #define STHROWF(m, ...) SqThrowF(fmt::runtime(m " =>[" __FILE__ ":" SQMOD_STRINGIZEWRAP(__LINE__) "] "), ##__VA_ARGS__)
#define STHROWLASTF(m, ...) SqThrowLastF(m " =>[" __FILE__ ":" SQMOD_STRINGIZEWRAP(__LINE__) "] ", ##__VA_ARGS__) #define STHROWLASTF(m, ...) SqThrowLastF(m " =>[" __FILE__ ":" SQMOD_STRINGIZEWRAP(__LINE__) "] ", ##__VA_ARGS__)
#else #else
#define STHROW(e, m, ...) throw e(m, ##__VA_ARGS__) #define STHROW(e, m, ...) throw e(m, ##__VA_ARGS__)