[HarfBuzz] harfbuzz: Branch 'master'
Behdad Esfahbod
behdad at kemper.freedesktop.org
Mon Jul 23 20:34:47 UTC 2018
src/hb-common.cc | 9 +++++++++
src/hb-private.hh | 20 ++------------------
src/hb-static.cc | 4 +++-
3 files changed, 14 insertions(+), 19 deletions(-)
New commits:
commit e22a48ac95a60fac5e1bca26eed7f5623d73a7be
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Mon Jul 23 13:24:26 2018 -0700
One more visibility trick
Should fix Windows build again.
diff --git a/src/hb-common.cc b/src/hb-common.cc
index 243c2163..8ec269eb 100644
--- a/src/hb-common.cc
+++ b/src/hb-common.cc
@@ -1069,3 +1069,12 @@ hb_variation_to_string (hb_variation_t *variation,
memcpy (buf, s, len);
buf[len] = '\0';
}
+
+/* If there is no visibility control, then hb-static.cc will NOT
+ * define anything. Instead, we get it to define one set in here
+ * only, so only libharfbuzz.so defines them, not other libs. */
+#ifdef HB_NO_VISIBILITY
+#undef HB_NO_VISIBILITY
+#include "hb-static.cc"
+#define HB_NO_VISIBILITY 1
+#endif
diff --git a/src/hb-private.hh b/src/hb-private.hh
index ddb256f8..37a2eb8d 100644
--- a/src/hb-private.hh
+++ b/src/hb-private.hh
@@ -375,16 +375,8 @@ typedef uint64_t hb_vector_size_impl_t;
#define HB_NULL_POOL_SIZE 264
-#ifdef HB_NO_VISIBILITY
-static
-#else
extern HB_INTERNAL
-#endif
-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)]
-#ifdef HB_NO_VISIBILITY
-= {}
-#endif
-;
+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)];
/* Generic nul-content Null objects. */
template <typename Type>
@@ -413,16 +405,8 @@ static_assert (Namespace::Type::min_size + 1 <= sizeof (_Null##Type), "Null pool
* for correct operation. It only exist to catch and divert program logic bugs instead of
* causing bad memory access. So, races there are not actually introducing incorrectness
* in the code. Has ~12kb binary size overhead to have it, also clang build fails with it. */
-#ifdef HB_NO_VISIBILITY
-static
-#else
extern HB_INTERNAL
-#endif
-/*thread_local*/ hb_vector_size_impl_t _hb_CrapPool[(HB_NULL_POOL_SIZE + sizeof (hb_vector_size_impl_t) - 1) / sizeof (hb_vector_size_impl_t)]
-#ifdef HB_NO_VISIBILITY
-= {}
-#endif
-;
+/*thread_local*/ hb_vector_size_impl_t _hb_CrapPool[(HB_NULL_POOL_SIZE + sizeof (hb_vector_size_impl_t) - 1) / sizeof (hb_vector_size_impl_t)];
/* CRAP pool: Common Region for Access Protection. */
template <typename Type>
diff --git a/src/hb-static.cc b/src/hb-static.cc
index 729b242c..bc4bf547 100644
--- a/src/hb-static.cc
+++ b/src/hb-static.cc
@@ -31,9 +31,9 @@
#include "hb-ot-maxp-table.hh"
#ifndef HB_NO_VISIBILITY
+
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)] = {};
/*thread_local*/ hb_vector_size_impl_t _hb_CrapPool[(HB_NULL_POOL_SIZE + sizeof (hb_vector_size_impl_t) - 1) / sizeof (hb_vector_size_impl_t)] = {};
-#endif
void
hb_face_t::load_num_glyphs (void) const
@@ -52,3 +52,5 @@ hb_face_t::load_upem (void) const
upem = head_table->get_upem ();
hb_blob_destroy (head_blob);
}
+
+#endif
More information about the HarfBuzz
mailing list