summaryrefslogtreecommitdiffstats
path: root/src/core/common.h
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2021-08-08 14:34:02 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2021-08-08 14:34:02 +0200
commit88b4c7b50b032f06510fec278babe7502cd85d64 (patch)
treea3696b405ab314eb845766c57f4c3e941753c3d5 /src/core/common.h
parentMerge pull request #1266 from Nick007J/miami (diff)
parentCVehicle fixes and cleanup (diff)
downloadre3-88b4c7b50b032f06510fec278babe7502cd85d64.tar
re3-88b4c7b50b032f06510fec278babe7502cd85d64.tar.gz
re3-88b4c7b50b032f06510fec278babe7502cd85d64.tar.bz2
re3-88b4c7b50b032f06510fec278babe7502cd85d64.tar.lz
re3-88b4c7b50b032f06510fec278babe7502cd85d64.tar.xz
re3-88b4c7b50b032f06510fec278babe7502cd85d64.tar.zst
re3-88b4c7b50b032f06510fec278babe7502cd85d64.zip
Diffstat (limited to 'src/core/common.h')
-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 6f6acd49..9d3bca67 100644
--- a/src/core/common.h
+++ b/src/core/common.h
@@ -372,8 +372,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)
+#ifdef 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