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

Add the exception throwing macros to the base module header as well.

This commit is contained in:
Sandu Liviu Catalin 2016-03-22 16:54:40 +02:00
parent bcdb9707f0
commit 933f96fbc5

View File

@ -275,6 +275,31 @@ using namespace Sqrat;
#define SQMOD_FORCEINLINE inline
#endif
/* ------------------------------------------------------------------------------------------------
* LOGGING LOCATION
*/
#define SQMOD_TRUESTRINGIZE(x) #x
#define SQMOD_STRINGIZEWRAP(x) SQMOD_TRUESTRINGIZE(x)
#if defined(_DEBUG) || defined(SQMOD_EXCEPTLOC)
#define SQMOD_MSGLOC(m) (m " =>[" __FILE__ ":" SQMOD_STRINGIZEWRAP(__LINE__) "] ")
#else
#define SQMOD_MSGLOC(m) (m)
#endif // _DEBUG
/* ------------------------------------------------------------------------------------------------
* EXCEPTION THROWING
*/
#if defined(_DEBUG) || defined(SQMOD_EXCEPTLOC)
#define STHROW(e, m, ...) throw e(m " =>[" __FILE__ ":" SQMOD_STRINGIZEWRAP(__LINE__) "] ", ##__VA_ARGS__)
#define STHROWF(m, ...) SqThrowF(m " =>[" __FILE__ ":" SQMOD_STRINGIZEWRAP(__LINE__) "] ", ##__VA_ARGS__)
#else
#define STHROW(e, m, ...) throw e(m, ##__VA_ARGS__)
#define STHROWF(m, ...) SqThrowF(m, ##__VA_ARGS__)
#endif // _DEBUG
/* ------------------------------------------------------------------------------------------------
* VARIOUS DEFINES
*/