summaryrefslogtreecommitdiffstats
path: root/src/core/common.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/core/common.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/common.h b/src/core/common.h
index 66a3ad81..f79b199b 100644
--- a/src/core/common.h
+++ b/src/core/common.h
@@ -58,6 +58,9 @@
#define Max(a,b) ((a) > (b) ? (a) : (b))
#define Min(a,b) ((a) < (b) ? (a) : (b))
+// Use this to add const that wasn't there in the original code
+#define Const const
+
typedef uint8_t uint8;
typedef int8_t int8;
typedef uint16_t uint16;
@@ -225,7 +228,11 @@ void re3_usererror(const char *format, ...);
#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)))