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.
pull/383/head
nvelinov 8 years ago committed by Behdad Esfahbod
parent e2b878055b
commit 7d1c5d8281
  1. 2
      src/hb-open-type-private.hh

@ -105,7 +105,7 @@ static inline Type& StructAfter(TObject &X)
inline unsigned int get_size (void) const { return (size); }
#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)
#define DEFINE_SIZE_MIN(size) \

Loading…
Cancel
Save