[null] Add DECLARE_NULL_NAMESPACE_BYTES_TEMPLATE1
This commit is contained in:
parent
ea11029a6e
commit
1e503f587b
|
@ -415,18 +415,7 @@ struct Lookup
|
||||||
public:
|
public:
|
||||||
DEFINE_SIZE_UNION (2, format);
|
DEFINE_SIZE_UNION (2, format);
|
||||||
};
|
};
|
||||||
/* Lookup 0 has unbounded size (dependant on num_glyphs). So we need to defined
|
DECLARE_NULL_NAMESPACE_BYTES_TEMPLATE1 (AAT, Lookup, 2);
|
||||||
* special NULL objects for Lookup<> objects, but since it's template our macros
|
|
||||||
* don't work. So we have to hand-code them here. UGLY. */
|
|
||||||
} /* Close namespace. */
|
|
||||||
/* Ugly hand-coded null objects for template Lookup<> :(. */
|
|
||||||
extern HB_INTERNAL const unsigned char _hb_Null_AAT_Lookup[2];
|
|
||||||
template <typename T>
|
|
||||||
struct Null<AAT::Lookup<T>> {
|
|
||||||
static AAT::Lookup<T> const & get_null ()
|
|
||||||
{ return *reinterpret_cast<const AAT::Lookup<T> *> (_hb_Null_AAT_Lookup); }
|
|
||||||
};
|
|
||||||
namespace AAT {
|
|
||||||
|
|
||||||
enum { DELETED_GLYPH = 0xFFFF };
|
enum { DELETED_GLYPH = 0xFFFF };
|
||||||
|
|
||||||
|
|
|
@ -117,8 +117,19 @@ struct NullHelper
|
||||||
}; \
|
}; \
|
||||||
namespace Namespace { \
|
namespace Namespace { \
|
||||||
static_assert (true, "") /* Require semicolon after. */
|
static_assert (true, "") /* Require semicolon after. */
|
||||||
|
#define DECLARE_NULL_NAMESPACE_BYTES_TEMPLATE1(Namespace, Type, Size) \
|
||||||
|
} /* Close namespace. */ \
|
||||||
|
extern HB_INTERNAL const unsigned char _hb_Null_##Namespace##_##Type[Size]; \
|
||||||
|
template <typename Spec> \
|
||||||
|
struct Null<Namespace::Type<Spec>> { \
|
||||||
|
static Namespace::Type<Spec> const & get_null () { \
|
||||||
|
return *reinterpret_cast<const Namespace::Type<Spec> *> (_hb_Null_##Namespace##_##Type); \
|
||||||
|
} \
|
||||||
|
}; \
|
||||||
|
namespace Namespace { \
|
||||||
|
static_assert (true, "") /* Require semicolon after. */
|
||||||
#define DEFINE_NULL_NAMESPACE_BYTES(Namespace, Type) \
|
#define DEFINE_NULL_NAMESPACE_BYTES(Namespace, Type) \
|
||||||
const unsigned char _hb_Null_##Namespace##_##Type[hb_null_size (Namespace::Type)]
|
const unsigned char _hb_Null_##Namespace##_##Type[sizeof (_hb_Null_##Namespace##_##Type)]
|
||||||
|
|
||||||
/* Specializations for arbitrary-content Null objects expressed as struct initializer. */
|
/* Specializations for arbitrary-content Null objects expressed as struct initializer. */
|
||||||
#define DECLARE_NULL_INSTANCE(Type) \
|
#define DECLARE_NULL_INSTANCE(Type) \
|
||||||
|
|
|
@ -49,8 +49,7 @@ DEFINE_NULL_NAMESPACE_BYTES (OT, LangSys) = {0x00,0x00, 0xFF,0xFF, 0x00,0x00};
|
||||||
DEFINE_NULL_NAMESPACE_BYTES (OT, RangeRecord) = {0x00,0x01, 0x00,0x00, 0x00, 0x00};
|
DEFINE_NULL_NAMESPACE_BYTES (OT, RangeRecord) = {0x00,0x01, 0x00,0x00, 0x00, 0x00};
|
||||||
DEFINE_NULL_NAMESPACE_BYTES (OT, CmapSubtableLongGroup) = {0x00,0x00,0x00,0x01, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00};
|
DEFINE_NULL_NAMESPACE_BYTES (OT, CmapSubtableLongGroup) = {0x00,0x00,0x00,0x01, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00};
|
||||||
DEFINE_NULL_NAMESPACE_BYTES (AAT, SettingName) = {0xFF,0xFF, 0xFF,0xFF};
|
DEFINE_NULL_NAMESPACE_BYTES (AAT, SettingName) = {0xFF,0xFF, 0xFF,0xFF};
|
||||||
/* Hand-coded because Lookup is a template. Sad. */
|
DEFINE_NULL_NAMESPACE_BYTES (AAT, Lookup) = {0xFF,0xFF};
|
||||||
const unsigned char _hb_Null_AAT_Lookup[2] = {0xFF, 0xFF};
|
|
||||||
|
|
||||||
|
|
||||||
/* hb_map_t */
|
/* hb_map_t */
|
||||||
|
|
Loading…
Reference in New Issue