From: Michiharu Ariza Date: Thu, 29 Nov 2018 00:27:45 +0000 (-0800) Subject: Merge branch 'master' into cff-subset X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=32d291ae899eb095500052bed2a22e5255a34838;p=platform%2Fupstream%2FlibHarfBuzzSharp.git Merge branch 'master' into cff-subset --- 32d291ae899eb095500052bed2a22e5255a34838 diff --cc src/hb-null.hh index bc9438d,1583d5b..080e0b5 --- a/src/hb-null.hh +++ b/src/hb-null.hh @@@ -36,8 -36,47 +36,47 @@@ /* Global nul-content Null pool. Enlarge as necessary. */ -#define HB_NULL_POOL_SIZE 1024 +#define HB_NULL_POOL_SIZE 9880 + /* Use SFINAE to sniff whether T has min_size; in which case return T::null_size, + * otherwise return sizeof(T). */ + + /* 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 + struct _hb_null_size + { enum { value = sizeof (T) }; }; + template + struct _hb_null_size > + { enum { value = T::null_size }; }; + + template + 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)];