diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2021-08-08 15:46:47 +0300 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2021-08-08 15:46:47 +0300 |
commit | 74f00c3c6362f1fe7ee9d25a99ee8db5ce4e88dd (patch) | |
tree | ebe621b0d748a1a8854760cdfbd227ce7d93d164 /src/core/common.h | |
parent | 9cc12018928b73acccd575970a6e4dbcb5b460ac (diff) | |
parent | 668311a444a350dea9f23e5828722a5f40e7a3d5 (diff) |
merge
Diffstat (limited to 'src/core/common.h')
-rw-r--r-- | src/core/common.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/common.h b/src/core/common.h index bb6b93d3..57961f08 100644 --- a/src/core/common.h +++ b/src/core/common.h @@ -386,8 +386,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 |