Hide a few static methods
Looks like static methods that do not get inlined end up exported.
We have a lot more. Need to protect all at some point. Wish there
was an easier way, like the visibility flag we pass that automatically
hides all inline methods.
Was exposed by check-symbols.sh when compiling on OS X 10.14 with:
$ make CPPFLAGS=-Oz CXXFLAGS=-flto=thin LDFLAGS=-lc++
diff --git a/src/hb-aat-layout.hh b/src/hb-aat-layout.hh
index 8346d9f..6340924 100644
--- a/src/hb-aat-layout.hh
+++ b/src/hb-aat-layout.hh
@@ -39,7 +39,7 @@
hb_aat_layout_feature_selector_t selectorToEnable;
hb_aat_layout_feature_selector_t selectorToDisable;
- static int cmp (const void *key_, const void *entry_)
+ HB_INTERNAL static int cmp (const void *key_, const void *entry_)
{
hb_tag_t key = * (unsigned int *) key_;
const hb_aat_feature_mapping_t * entry = (const hb_aat_feature_mapping_t *) entry_;
diff --git a/src/hb-aat-map.hh b/src/hb-aat-map.hh
index f103d27..984a59c 100644
--- a/src/hb-aat-map.hh
+++ b/src/hb-aat-map.hh
@@ -66,7 +66,7 @@
hb_aat_layout_feature_selector_t setting;
unsigned seq; /* For stable sorting only. */
- static int cmp (const void *pa, const void *pb)
+ HB_INTERNAL static int cmp (const void *pa, const void *pb)
{
const feature_info_t *a = (const feature_info_t *) pa;
const feature_info_t *b = (const feature_info_t *) pb;
diff --git a/src/hb-array.hh b/src/hb-array.hh
index 2bfbdd4..cfef75d 100644
--- a/src/hb-array.hh
+++ b/src/hb-array.hh
@@ -100,7 +100,7 @@
return (int) a.length - (int) length;
return hb_memcmp (a.arrayZ, arrayZ, get_size ());
}
- static int cmp (const void *pa, const void *pb)
+ HB_INTERNAL static int cmp (const void *pa, const void *pb)
{
hb_array_t<Type> *a = (hb_array_t<Type> *) pa;
hb_array_t<Type> *b = (hb_array_t<Type> *) pb;
diff --git a/src/hb-coretext.cc b/src/hb-coretext.cc
index 4923561..66f0fce 100644
--- a/src/hb-coretext.cc
+++ b/src/hb-coretext.cc
@@ -410,7 +410,7 @@
feature_record_t rec;
unsigned int order;
- static int cmp (const void *pa, const void *pb) {
+ HB_INTERNAL static int cmp (const void *pa, const void *pb) {
const active_feature_t *a = (const active_feature_t *) pa;
const active_feature_t *b = (const active_feature_t *) pb;
return a->rec.feature < b->rec.feature ? -1 : a->rec.feature > b->rec.feature ? 1 :
@@ -428,7 +428,7 @@
bool start;
active_feature_t feature;
- static int cmp (const void *pa, const void *pb) {
+ HB_INTERNAL static int cmp (const void *pa, const void *pb) {
const feature_event_t *a = (const feature_event_t *) pa;
const feature_event_t *b = (const feature_event_t *) pb;
return a->index < b->index ? -1 : a->index > b->index ? 1 :
diff --git a/src/hb-open-file.hh b/src/hb-open-file.hh
index 03d27c1..7b140fa 100644
--- a/src/hb-open-file.hh
+++ b/src/hb-open-file.hh
@@ -56,7 +56,7 @@
{
int cmp (Tag t) const { return -t.cmp (tag); }
- static int cmp (const void *pa, const void *pb)
+ HB_INTERNAL static int cmp (const void *pa, const void *pb)
{
const TableRecord *a = (const TableRecord *) pa;
const TableRecord *b = (const TableRecord *) pb;
diff --git a/src/hb-open-type.hh b/src/hb-open-type.hh
index c470729..05b8c72 100644
--- a/src/hb-open-type.hh
+++ b/src/hb-open-type.hh
@@ -63,7 +63,8 @@
operator wide_type () const { return v; }
bool operator == (const IntType<Type,Size> &o) const { return (Type) v == (Type) o.v; }
bool operator != (const IntType<Type,Size> &o) const { return !(*this == o); }
- static int cmp (const IntType<Type,Size> *a, const IntType<Type,Size> *b) { return b->cmp (*a); }
+ HB_INTERNAL static int cmp (const IntType<Type,Size> *a, const IntType<Type,Size> *b)
+ { return b->cmp (*a); }
template <typename Type2>
int cmp (Type2 a) const
{
diff --git a/src/hb-ot-cmap-table.hh b/src/hb-ot-cmap-table.hh
index add5325..08f186e 100644
--- a/src/hb-ot-cmap-table.hh
+++ b/src/hb-ot-cmap-table.hh
@@ -285,7 +285,7 @@
*glyph = gid;
return true;
}
- static bool get_glyph_func (const void *obj, hb_codepoint_t codepoint, hb_codepoint_t *glyph)
+ HB_INTERNAL static bool get_glyph_func (const void *obj, hb_codepoint_t codepoint, hb_codepoint_t *glyph)
{
return ((const accelerator_t *) obj)->get_glyph (codepoint, glyph);
}
@@ -1096,18 +1096,18 @@
hb_codepoint_t *glyph);
template <typename Type>
- static bool get_glyph_from (const void *obj,
- hb_codepoint_t codepoint,
- hb_codepoint_t *glyph)
+ HB_INTERNAL static bool get_glyph_from (const void *obj,
+ hb_codepoint_t codepoint,
+ hb_codepoint_t *glyph)
{
const Type *typed_obj = (const Type *) obj;
return typed_obj->get_glyph (codepoint, glyph);
}
template <typename Type>
- static bool get_glyph_from_symbol (const void *obj,
- hb_codepoint_t codepoint,
- hb_codepoint_t *glyph)
+ HB_INTERNAL static bool get_glyph_from_symbol (const void *obj,
+ hb_codepoint_t codepoint,
+ hb_codepoint_t *glyph)
{
const Type *typed_obj = (const Type *) obj;
if (likely (typed_obj->get_glyph (codepoint, glyph)))
diff --git a/src/hb-ot-layout-base-table.hh b/src/hb-ot-layout-base-table.hh
index dd0fba1..7ef573e 100644
--- a/src/hb-ot-layout-base-table.hh
+++ b/src/hb-ot-layout-base-table.hh
@@ -153,7 +153,7 @@
struct FeatMinMaxRecord
{
- static int cmp (const void *key_, const void *entry_)
+ HB_INTERNAL static int cmp (const void *key_, const void *entry_)
{
hb_tag_t key = * (hb_tag_t *) key_;
const FeatMinMaxRecord &entry = * (const FeatMinMaxRecord *) entry_;
@@ -271,7 +271,7 @@
struct BaseLangSysRecord
{
- static int cmp (const void *key_, const void *entry_)
+ HB_INTERNAL static int cmp (const void *key_, const void *entry_)
{
hb_tag_t key = * (hb_tag_t *) key_;
const BaseLangSysRecord &entry = * (const BaseLangSysRecord *) entry_;
@@ -345,7 +345,7 @@
struct BaseScriptList;
struct BaseScriptRecord
{
- static int cmp (const void *key_, const void *entry_)
+ HB_INTERNAL static int cmp (const void *key_, const void *entry_)
{
hb_tag_t key = * (hb_tag_t *) key_;
const BaseScriptRecord &entry = * (const BaseScriptRecord *) entry_;
diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh
index 795853a..a7257df 100644
--- a/src/hb-ot-layout-gpos-table.hh
+++ b/src/hb-ot-layout-gpos-table.hh
@@ -173,15 +173,15 @@
return true;
}
- static OffsetTo<Device>& get_device (Value* value)
+ HB_INTERNAL static OffsetTo<Device>& get_device (Value* value)
{ return *CastP<OffsetTo<Device> > (value); }
- static const OffsetTo<Device>& get_device (const Value* value, bool *worked=nullptr)
+ HB_INTERNAL static const OffsetTo<Device>& get_device (const Value* value, bool *worked=nullptr)
{
if (worked) *worked |= bool (*value);
return *CastP<OffsetTo<Device> > (value);
}
- static const HBINT16& get_short (const Value* value, bool *worked=nullptr)
+ HB_INTERNAL static const HBINT16& get_short (const Value* value, bool *worked=nullptr)
{
if (worked) *worked |= bool (*value);
return *CastP<HBINT16> (value);
@@ -1576,7 +1576,7 @@
dispatch (&c);
}
- static bool apply_recurse_func (hb_ot_apply_context_t *c, unsigned int lookup_index);
+ HB_INTERNAL static bool apply_recurse_func (hb_ot_apply_context_t *c, unsigned int lookup_index);
template <typename context_t>
static typename context_t::return_t dispatch_recurse_func (context_t *c, unsigned int lookup_index);
diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh
index 6c82bf2..e664e06 100644
--- a/src/hb-ot-layout-gsub-table.hh
+++ b/src/hb-ot-layout-gsub-table.hh
@@ -1194,7 +1194,7 @@
const SubTable& get_subtable (unsigned int i) const
{ return Lookup::get_subtable<SubTable> (i); }
- static bool lookup_type_is_reverse (unsigned int lookup_type)
+ HB_INTERNAL static bool lookup_type_is_reverse (unsigned int lookup_type)
{ return lookup_type == SubTable::ReverseChainSingle; }
bool is_reverse () const
@@ -1252,7 +1252,7 @@
return dispatch (c);
}
- static bool apply_recurse_func (hb_ot_apply_context_t *c, unsigned int lookup_index);
+ HB_INTERNAL static bool apply_recurse_func (hb_ot_apply_context_t *c, unsigned int lookup_index);
SubTable& serialize_subtable (hb_serialize_context_t *c,
unsigned int i)
@@ -1315,9 +1315,9 @@
}
template <typename context_t>
- static typename context_t::return_t dispatch_recurse_func (context_t *c, unsigned int lookup_index);
+ HB_INTERNAL static typename context_t::return_t dispatch_recurse_func (context_t *c, unsigned int lookup_index);
- static hb_closure_context_t::return_t dispatch_closure_recurse_func (hb_closure_context_t *c, unsigned int lookup_index)
+ HB_INTERNAL static hb_closure_context_t::return_t dispatch_closure_recurse_func (hb_closure_context_t *c, unsigned int lookup_index)
{
if (!c->should_visit_lookup (lookup_index))
return hb_void_t ();
diff --git a/src/hb-ot-layout-gsubgpos.hh b/src/hb-ot-layout-gsubgpos.hh
index 96777de..2e9165b 100644
--- a/src/hb-ot-layout-gsubgpos.hh
+++ b/src/hb-ot-layout-gsubgpos.hh
@@ -613,7 +613,7 @@
hb_dispatch_context_t<hb_get_subtables_context_t, hb_void_t, HB_DEBUG_APPLY>
{
template <typename Type>
- static bool apply_to (const void *obj, OT::hb_ot_apply_context_t *c)
+ HB_INTERNAL static bool apply_to (const void *obj, OT::hb_ot_apply_context_t *c)
{
const Type *typed_obj = (const Type *) obj;
return typed_obj->apply (c);
diff --git a/src/hb-ot-map.hh b/src/hb-ot-map.hh
index 132da55..dd67786 100644
--- a/src/hb-ot-map.hh
+++ b/src/hb-ot-map.hh
@@ -68,7 +68,7 @@
unsigned short random : 1;
hb_mask_t mask;
- static int cmp (const void *pa, const void *pb)
+ HB_INTERNAL static int cmp (const void *pa, const void *pb)
{
const lookup_map_t *a = (const lookup_map_t *) pa;
const lookup_map_t *b = (const lookup_map_t *) pb;
@@ -247,7 +247,7 @@
unsigned int default_value; /* for non-global features, what should the unset glyphs take */
unsigned int stage[2]; /* GSUB/GPOS */
- static int cmp (const void *pa, const void *pb)
+ HB_INTERNAL static int cmp (const void *pa, const void *pb)
{
const feature_info_t *a = (const feature_info_t *) pa;
const feature_info_t *b = (const feature_info_t *) pb;
diff --git a/src/hb-uniscribe.cc b/src/hb-uniscribe.cc
index f9d9f3d..4bbbf61 100644
--- a/src/hb-uniscribe.cc
+++ b/src/hb-uniscribe.cc
@@ -283,7 +283,7 @@
OPENTYPE_FEATURE_RECORD rec;
unsigned int order;
- static int cmp (const void *pa, const void *pb) {
+ HB_INTERNAL static int cmp (const void *pa, const void *pb) {
const active_feature_t *a = (const active_feature_t *) pa;
const active_feature_t *b = (const active_feature_t *) pb;
return a->rec.tagFeature < b->rec.tagFeature ? -1 : a->rec.tagFeature > b->rec.tagFeature ? 1 :
@@ -300,7 +300,7 @@
bool start;
active_feature_t feature;
- static int cmp (const void *pa, const void *pb)
+ HB_INTERNAL static int cmp (const void *pa, const void *pb)
{
const feature_event_t *a = (const feature_event_t *) pa;
const feature_event_t *b = (const feature_event_t *) pb;