From fb10c021c8a32f8dc054f008caf86af82667e109 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 22 Nov 2018 00:21:49 -0500 Subject: [PATCH] Revert alignof() == 1 check Bots not happy with using "this" inside assertion... This reverts 2656644887e77a9d814bb12374af3c26b42fd935 --- src/hb-machinery.hh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/hb-machinery.hh b/src/hb-machinery.hh index 2f57fb6b4..f29a02aad 100644 --- a/src/hb-machinery.hh +++ b/src/hb-machinery.hh @@ -97,8 +97,7 @@ static inline Type& StructAfter(TObject &X) #define DEFINE_SIZE_STATIC(size) \ - DEFINE_INSTANCE_ASSERTION (alignof (*this) == 1 && \ - sizeof (*this) == (size)); \ + DEFINE_INSTANCE_ASSERTION (sizeof (*this) == (size)); \ inline unsigned int get_size (void) const { return (size); } \ enum { null_size = (size) }; \ enum { min_size = (size) }; \ @@ -106,21 +105,18 @@ static inline Type& StructAfter(TObject &X) #define DEFINE_SIZE_UNION(size, _member) \ DEFINE_COMPILES_ASSERTION ((void) this->u._member.static_size); \ - DEFINE_INSTANCE_ASSERTION (alignof (*this) == 1 && \ - sizeof(this->u._member) == (size)); \ + DEFINE_INSTANCE_ASSERTION (sizeof(this->u._member) == (size)); \ enum { null_size = (size) }; \ enum { min_size = (size) } #define DEFINE_SIZE_MIN(size) \ - DEFINE_INSTANCE_ASSERTION (alignof (*this) == 1 && \ - sizeof (*this) >= (size)); \ + DEFINE_INSTANCE_ASSERTION (sizeof (*this) >= (size)); \ enum { null_size = (size) }; \ enum { min_size = (size) } #define DEFINE_SIZE_ARRAY(size, array) \ DEFINE_COMPILES_ASSERTION ((void) (array)[0].static_size); \ - DEFINE_INSTANCE_ASSERTION (alignof (*this) == 1 && \ - sizeof (*this) == (size) + VAR * sizeof ((array)[0])); \ + DEFINE_INSTANCE_ASSERTION (sizeof (*this) == (size) + VAR * sizeof ((array)[0])); \ enum { null_size = (size) }; \ enum { min_size = (size) }