diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2020-05-11 20:21:09 +0200 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2020-05-11 20:21:09 +0200 |
commit | 9b23e33c36facdad4b6f669501dbee7fa82ef50a (patch) | |
tree | 3f81b31669c2187720881afa07e2ed3db93d6694 /src/core/common.h | |
parent | Merge remote-tracking branch 'upstream/miami' into miami (diff) | |
parent | Merge remote-tracking branch 'origin/master' into miami (diff) | |
download | re3-9b23e33c36facdad4b6f669501dbee7fa82ef50a.tar re3-9b23e33c36facdad4b6f669501dbee7fa82ef50a.tar.gz re3-9b23e33c36facdad4b6f669501dbee7fa82ef50a.tar.bz2 re3-9b23e33c36facdad4b6f669501dbee7fa82ef50a.tar.lz re3-9b23e33c36facdad4b6f669501dbee7fa82ef50a.tar.xz re3-9b23e33c36facdad4b6f669501dbee7fa82ef50a.tar.zst re3-9b23e33c36facdad4b6f669501dbee7fa82ef50a.zip |
Diffstat (limited to 'src/core/common.h')
-rw-r--r-- | src/core/common.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/common.h b/src/core/common.h index 8f400a46..ed331bbb 100644 --- a/src/core/common.h +++ b/src/core/common.h @@ -213,6 +213,7 @@ void mysrand(unsigned int seed); void re3_debug(const char *format, ...); void re3_trace(const char *filename, unsigned int lineno, const char *func, const char *format, ...); void re3_assert(const char *expr, const char *filename, unsigned int lineno, const char *func); +void re3_usererror(const char *format, ...); #define DEBUGBREAK() __debugbreak(); @@ -220,6 +221,7 @@ void re3_assert(const char *expr, const char *filename, unsigned int lineno, con #define DEV(f, ...) re3_debug("[DEV]: " f, ## __VA_ARGS__) #define TRACE(f, ...) re3_trace(__FILE__, __LINE__, __FUNCTION__, f, ## __VA_ARGS__) #define Error(f, ...) re3_debug("[ERROR]: " f, ## __VA_ARGS__) +#define USERERROR(f, ...) re3_usererror(f, ## __VA_ARGS__) #define assert(_Expression) (void)( (!!(_Expression)) || (re3_assert(#_Expression, __FILE__, __LINE__, __FUNCTION__), 0) ) #define ASSERT assert @@ -227,7 +229,11 @@ void re3_assert(const char *expr, const char *filename, unsigned int lineno, con #define _TODO(x) #define _TODOCONST(x) (x) +#ifdef CHECK_STRUCT_SIZES #define VALIDATE_SIZE(struc, size) static_assert(sizeof(struc) == size, "Invalid structure size of " #struc) +#else +#define VALIDATE_SIZE(struc, size) +#endif #define VALIDATE_OFFSET(struc, member, offset) static_assert(offsetof(struc, member) == offset, "The offset of " #member " in " #struc " is not " #offset "...") #define PERCENT(x, p) ((float(x) * (float(p) / 100.0f))) |