mirror of
https://git.rip/DMCA_FUCKER/re3.git
synced 2024-12-23 00:00:00 +00:00
Better output for validating size assert
This commit is contained in:
parent
d77846bb16
commit
609cad506f
|
@ -364,8 +364,11 @@ __inline__ void TRACE(char *f, ...) { } // this is re3 only, and so the function
|
||||||
#define _TODO(x)
|
#define _TODO(x)
|
||||||
#define _TODOCONST(x) (x)
|
#define _TODOCONST(x) (x)
|
||||||
|
|
||||||
#ifdef CHECK_STRUCT_SIZES
|
#if CHECK_STRUCT_SIZES
|
||||||
#define VALIDATE_SIZE(struc, size) static_assert(sizeof(struc) == size, "Invalid structure size of " #struc)
|
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
|
#else
|
||||||
#define VALIDATE_SIZE(struc, size)
|
#define VALIDATE_SIZE(struc, size)
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue