From 7d1c5d8281b05a5c178ea3ae048b0062145968aa Mon Sep 17 00:00:00 2001 From: nvelinov Date: Sat, 24 Dec 2016 02:46:37 +0100 Subject: [PATCH] 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. --- src/hb-open-type-private.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh index 5b7ff337e..2cc1fb20d 100644 --- a/src/hb-open-type-private.hh +++ b/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) \