diff --git a/src/hb-null.hh b/src/hb-null.hh index c0cefc9a8..1583d5b90 100644 --- a/src/hb-null.hh +++ b/src/hb-null.hh @@ -44,6 +44,7 @@ /* The hard way... * https://stackoverflow.com/questions/7776448/sfinae-tried-with-bool-gives-compiler-error-template-argument-tvalue-invol */ + template struct _hb_bool_type {}; template @@ -58,6 +59,24 @@ struct hb_null_size { enum { value = _hb_null_size >::value }; }; #define hb_null_size(T) hb_null_size::value +/* This doesn't belong here, but since is copy/paste from above, put it here. */ + +template +struct _hb_static_size +{ enum { value = sizeof (T) }; }; +template +struct _hb_static_size > +{ enum { value = T::static_size }; }; + +template +struct hb_static_size +{ enum { value = _hb_static_size >::value }; }; +#define hb_static_size(T) hb_static_size::value + + +/* + * Null() + */ extern HB_INTERNAL hb_vector_size_impl_t const _hb_NullPool[(HB_NULL_POOL_SIZE + sizeof (hb_vector_size_impl_t) - 1) / sizeof (hb_vector_size_impl_t)];