mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-07-08 01:47:11 +02:00
Updated the exception system in the main plugin to also include the location in the source files in debug builds.
Moved the functions that extract base types from strings as static functions under the associated type. Revised some of the base shared code. Fixed some of the functions in the String library that did not take into account the null terminator.
This commit is contained in:
@ -502,6 +502,31 @@ enum CmdError
|
||||
#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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user