summaryrefslogtreecommitdiffstats
path: root/src/core/common.h
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-05-11 22:21:26 +0200
committeraap <aap@papnet.eu>2020-05-11 22:21:26 +0200
commit0eb5f93e96bfc4b31c0bde01e9f1296b3b612bc2 (patch)
tree16bf11e0e8a0353448a643322e9511e8ba659fca /src/core/common.h
parentCVisibilityPlugins (diff)
parentMerge remote-tracking branch 'origin/master' into miami (diff)
downloadre3-0eb5f93e96bfc4b31c0bde01e9f1296b3b612bc2.tar
re3-0eb5f93e96bfc4b31c0bde01e9f1296b3b612bc2.tar.gz
re3-0eb5f93e96bfc4b31c0bde01e9f1296b3b612bc2.tar.bz2
re3-0eb5f93e96bfc4b31c0bde01e9f1296b3b612bc2.tar.lz
re3-0eb5f93e96bfc4b31c0bde01e9f1296b3b612bc2.tar.xz
re3-0eb5f93e96bfc4b31c0bde01e9f1296b3b612bc2.tar.zst
re3-0eb5f93e96bfc4b31c0bde01e9f1296b3b612bc2.zip
Diffstat (limited to 'src/core/common.h')
-rw-r--r--src/core/common.h6
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)))