summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorFilip Gawin <filip.gawin@zoho.com>2021-01-22 19:54:43 +0100
committerFilip Gawin <filip.gawin@zoho.com>2021-01-22 19:54:43 +0100
commit609cad506ff43f3333b61f5ff39d1ec494eba42e (patch)
tree735d78ae474abc4ffce65c806187b3e01486e9de /src/core
parentMerge pull request #973 from withmorten/wantedlevel (diff)
downloadre3-609cad506ff43f3333b61f5ff39d1ec494eba42e.tar
re3-609cad506ff43f3333b61f5ff39d1ec494eba42e.tar.gz
re3-609cad506ff43f3333b61f5ff39d1ec494eba42e.tar.bz2
re3-609cad506ff43f3333b61f5ff39d1ec494eba42e.tar.lz
re3-609cad506ff43f3333b61f5ff39d1ec494eba42e.tar.xz
re3-609cad506ff43f3333b61f5ff39d1ec494eba42e.tar.zst
re3-609cad506ff43f3333b61f5ff39d1ec494eba42e.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/common.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/common.h b/src/core/common.h
index 84440968..13218983 100644
--- a/src/core/common.h
+++ b/src/core/common.h
@@ -364,8 +364,11 @@ __inline__ void TRACE(char *f, ...) { } // this is re3 only, and so the function
#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)
+#if CHECK_STRUCT_SIZES
+template<int s, int t> struct check_size {
+ static_assert(s == t, "Invalid structure size");
+};
+#define VALIDATE_SIZE(struc, size) check_size<sizeof(struc), size> struc ## Check
#else
#define VALIDATE_SIZE(struc, size)
#endif