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 struct check_size { + static_assert(s == t, "Invalid structure size"); +}; +#define VALIDATE_SIZE(struc, size) check_size struc ## Check #else #define VALIDATE_SIZE(struc, size) #endif