From 8d778877b88155dec1808a994416ead0b3d98ae7 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 21 Nov 2018 23:46:09 -0500 Subject: [PATCH] .. --- src/hb-machinery.hh | 8 ++++++-- src/hb-null.hh | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/hb-machinery.hh b/src/hb-machinery.hh index 24e45441..2f57fb6b 100644 --- a/src/hb-machinery.hh +++ b/src/hb-machinery.hh @@ -100,24 +100,28 @@ static inline Type& StructAfter(TObject &X) DEFINE_INSTANCE_ASSERTION (alignof (*this) == 1 && \ sizeof (*this) == (size)); \ inline unsigned int get_size (void) const { return (size); } \ - enum { static_size = (size) }; \ - enum { min_size = (size) } + enum { null_size = (size) }; \ + enum { min_size = (size) }; \ + enum { static_size = (size) } #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)); \ + enum { null_size = (size) }; \ enum { min_size = (size) } #define DEFINE_SIZE_MIN(size) \ DEFINE_INSTANCE_ASSERTION (alignof (*this) == 1 && \ 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])); \ + enum { null_size = (size) }; \ enum { min_size = (size) } #define DEFINE_SIZE_ARRAY_SIZED(size, array) \ diff --git a/src/hb-null.hh b/src/hb-null.hh index 25a24f05..51f653d2 100644 --- a/src/hb-null.hh +++ b/src/hb-null.hh @@ -52,7 +52,7 @@ static inline Type const & Null (void) { /* Specializations for arbitrary-content Null objects expressed in bytes. */ #define DECLARE_NULL_NAMESPACE_BYTES(Namespace, Type) \ } /* Close namespace. */ \ - extern HB_INTERNAL const unsigned char _hb_Null_##Namespace##_##Type[Namespace::Type::min_size]; \ + extern HB_INTERNAL const unsigned char _hb_Null_##Namespace##_##Type[Namespace::Type::null_size]; \ template <> \ /*static*/ inline const Namespace::Type& Null (void) { \ return *reinterpret_cast (_hb_Null_##Namespace##_##Type); \ @@ -60,7 +60,7 @@ static inline Type const & Null (void) { namespace Namespace { \ static_assert (true, "Just so we take semicolon after.") #define DEFINE_NULL_NAMESPACE_BYTES(Namespace, Type) \ - const unsigned char _hb_Null_##Namespace##_##Type[Namespace::Type::min_size] + const unsigned char _hb_Null_##Namespace##_##Type[Namespace::Type::null_size] /* Specializations for arbitrary-content Null objects expressed as struct initializer. */ #define DECLARE_NULL_INSTANCE(Type) \ -- GitLab