Compilation Error for ASSERT_STATIC on Some Compilers (#380)
* this pointer in type definitions is not interpreted as a constant. This rule is not enforced strictly by all compilers, but the Green Hills Software compiler will regard this as an error. * Merging branches for the DEFINE_SIZE_UNION macro Adding check for the existence of static_size field in the tested member.
This commit is contained in:
parent
e2b878055b
commit
7d1c5d8281
|
@ -105,7 +105,7 @@ static inline Type& StructAfter(TObject &X)
|
||||||
inline unsigned int get_size (void) const { return (size); }
|
inline unsigned int get_size (void) const { return (size); }
|
||||||
|
|
||||||
#define DEFINE_SIZE_UNION(size, _member) \
|
#define DEFINE_SIZE_UNION(size, _member) \
|
||||||
DEFINE_INSTANCE_ASSERTION (this->u._member.static_size == (size)); \
|
DEFINE_INSTANCE_ASSERTION (0*sizeof(this->u._member.static_size) + sizeof(this->u._member) == (size)); \
|
||||||
static const unsigned int min_size = (size)
|
static const unsigned int min_size = (size)
|
||||||
|
|
||||||
#define DEFINE_SIZE_MIN(size) \
|
#define DEFINE_SIZE_MIN(size) \
|
||||||
|
|
Loading…
Reference in New Issue