diff --git a/src/hb-map.hh b/src/hb-map.hh index ad52e69fe..5efad8d20 100644 --- a/src/hb-map.hh +++ b/src/hb-map.hh @@ -34,6 +34,8 @@ * hb_hashmap_t */ +extern HB_INTERNAL const hb_codepoint_t minus_1; + template struct hb_hashmap_t @@ -80,7 +82,11 @@ struct hb_hashmap_t static inline const V& default_value () { return Null(V); }; template - static inline const V& default_value () { static const V minus_1 = -1; return minus_1; }; + static inline const V& default_value () + { + static_assert (hb_is_same (V, hb_codepoint_t), ""); + return minus_1; + }; void clear () { diff --git a/src/hb-static.cc b/src/hb-static.cc index 7cc51be61..5c5ecce88 100644 --- a/src/hb-static.cc +++ b/src/hb-static.cc @@ -53,6 +53,9 @@ DEFINE_NULL_NAMESPACE_BYTES (AAT, SettingName) = {0xFF,0xFF, 0xFF,0xFF}; const unsigned char _hb_Null_AAT_Lookup[2] = {0xFF, 0xFF}; +/* hb_map_t */ + +const hb_codepoint_t minus_1 = -1; /* hb_face_t */