[HarfBuzz] harfbuzz: Branch 'master'
Behdad Esfahbod
behdad at kemper.freedesktop.org
Wed Nov 21 17:34:00 UTC 2018
src/hb-common.cc | 10 +++++-----
src/hb-ft.cc | 12 ++++++------
src/hb-glib.cc | 6 +++---
src/hb-icu.cc | 6 +++---
src/hb-ot-font.cc | 6 +++---
src/hb-shape.cc | 6 +++---
src/hb-shaper.cc | 6 +++---
src/hb-ucdn.cc | 6 +++---
src/hb-uniscribe.cc | 4 ++--
src/hb.hh | 5 ++++-
10 files changed, 35 insertions(+), 32 deletions(-)
New commits:
commit b89c7fd3dc505a958dd4b6acec0e0f8e57224fd8
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Wed Nov 21 12:32:48 2018 -0500
Allow defining HB_USE_ATEXIT to 0
That's better use of that value than requiring extra macro HB_NO_ATEXIT
diff --git a/src/hb-common.cc b/src/hb-common.cc
index 37be8a34..28b0c2b8 100644
--- a/src/hb-common.cc
+++ b/src/hb-common.cc
@@ -276,7 +276,7 @@ struct hb_language_item_t {
static hb_atomic_ptr_t <hb_language_item_t> langs;
-#ifdef HB_USE_ATEXIT
+#if HB_USE_ATEXIT
static void
free_langs (void)
{
@@ -323,7 +323,7 @@ retry:
goto retry;
}
-#ifdef HB_USE_ATEXIT
+#if HB_USE_ATEXIT
if (!first_lang)
atexit (free_langs); /* First person registers atexit() callback. */
#endif
@@ -780,7 +780,7 @@ parse_uint32 (const char **pp, const char *end, uint32_t *pv)
#ifdef USE_XLOCALE
-#ifdef HB_USE_ATEXIT
+#if HB_USE_ATEXIT
static void free_static_C_locale (void);
#endif
@@ -791,7 +791,7 @@ static struct hb_C_locale_lazy_loader_t : hb_lazy_loader_t<hb_remove_pointer<HB_
{
HB_LOCALE_T C_locale = HB_CREATE_LOCALE ("C");
-#ifdef HB_USE_ATEXIT
+#if HB_USE_ATEXIT
atexit (free_static_C_locale);
#endif
@@ -807,7 +807,7 @@ static struct hb_C_locale_lazy_loader_t : hb_lazy_loader_t<hb_remove_pointer<HB_
}
} static_C_locale;
-#ifdef HB_USE_ATEXIT
+#if HB_USE_ATEXIT
static
void free_static_C_locale (void)
{
diff --git a/src/hb-ft.cc b/src/hb-ft.cc
index 9b9d787d..fff0e285 100644
--- a/src/hb-ft.cc
+++ b/src/hb-ft.cc
@@ -478,7 +478,7 @@ hb_ft_get_font_h_extents (hb_font_t *font HB_UNUSED,
return true;
}
-#ifdef HB_USE_ATEXIT
+#if HB_USE_ATEXIT
static void free_static_ft_funcs (void);
#endif
@@ -504,7 +504,7 @@ static struct hb_ft_font_funcs_lazy_loader_t : hb_font_funcs_lazy_loader_t<hb_ft
hb_font_funcs_make_immutable (funcs);
-#ifdef HB_USE_ATEXIT
+#if HB_USE_ATEXIT
atexit (free_static_ft_funcs);
#endif
@@ -512,7 +512,7 @@ static struct hb_ft_font_funcs_lazy_loader_t : hb_font_funcs_lazy_loader_t<hb_ft
}
} static_ft_funcs;
-#ifdef HB_USE_ATEXIT
+#if HB_USE_ATEXIT
static
void free_static_ft_funcs (void)
{
@@ -744,7 +744,7 @@ hb_ft_font_create_referenced (FT_Face ft_face)
return hb_ft_font_create (ft_face, _hb_ft_face_destroy);
}
-#ifdef HB_USE_ATEXIT
+#if HB_USE_ATEXIT
static void free_static_ft_library (void);
#endif
@@ -757,7 +757,7 @@ static struct hb_ft_library_lazy_loader_t : hb_lazy_loader_t<hb_remove_pointer<F
if (FT_Init_FreeType (&l))
return nullptr;
-#ifdef HB_USE_ATEXIT
+#if HB_USE_ATEXIT
atexit (free_static_ft_library);
#endif
@@ -773,7 +773,7 @@ static struct hb_ft_library_lazy_loader_t : hb_lazy_loader_t<hb_remove_pointer<F
}
} static_ft_library;
-#ifdef HB_USE_ATEXIT
+#if HB_USE_ATEXIT
static
void free_static_ft_library (void)
{
diff --git a/src/hb-glib.cc b/src/hb-glib.cc
index 23a0d89c..cb7e7096 100644
--- a/src/hb-glib.cc
+++ b/src/hb-glib.cc
@@ -336,7 +336,7 @@ hb_glib_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED,
}
-#ifdef HB_USE_ATEXIT
+#if HB_USE_ATEXIT
static void free_static_glib_funcs (void);
#endif
@@ -355,7 +355,7 @@ static struct hb_glib_unicode_funcs_lazy_loader_t : hb_unicode_funcs_lazy_loader
hb_unicode_funcs_make_immutable (funcs);
-#ifdef HB_USE_ATEXIT
+#if HB_USE_ATEXIT
atexit (free_static_glib_funcs);
#endif
@@ -363,7 +363,7 @@ static struct hb_glib_unicode_funcs_lazy_loader_t : hb_unicode_funcs_lazy_loader
}
} static_glib_funcs;
-#ifdef HB_USE_ATEXIT
+#if HB_USE_ATEXIT
static
void free_static_glib_funcs (void)
{
diff --git a/src/hb-icu.cc b/src/hb-icu.cc
index 12864677..4e51eb01 100644
--- a/src/hb-icu.cc
+++ b/src/hb-icu.cc
@@ -300,7 +300,7 @@ hb_icu_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED,
}
-#ifdef HB_USE_ATEXIT
+#if HB_USE_ATEXIT
static void free_static_icu_funcs (void);
#endif
@@ -326,7 +326,7 @@ static struct hb_icu_unicode_funcs_lazy_loader_t : hb_unicode_funcs_lazy_loader_
hb_unicode_funcs_make_immutable (funcs);
-#ifdef HB_USE_ATEXIT
+#if HB_USE_ATEXIT
atexit (free_static_icu_funcs);
#endif
@@ -334,7 +334,7 @@ static struct hb_icu_unicode_funcs_lazy_loader_t : hb_unicode_funcs_lazy_loader_
}
} static_icu_funcs;
-#ifdef HB_USE_ATEXIT
+#if HB_USE_ATEXIT
static
void free_static_icu_funcs (void)
{
diff --git a/src/hb-ot-font.cc b/src/hb-ot-font.cc
index b19b25a3..7c913625 100644
--- a/src/hb-ot-font.cc
+++ b/src/hb-ot-font.cc
@@ -243,7 +243,7 @@ hb_ot_get_font_v_extents (hb_font_t *font,
return vmtx.has_font_extents;
}
-#ifdef HB_USE_ATEXIT
+#if HB_USE_ATEXIT
static void free_static_ot_funcs (void);
#endif
@@ -269,7 +269,7 @@ static struct hb_ot_font_funcs_lazy_loader_t : hb_font_funcs_lazy_loader_t<hb_ot
hb_font_funcs_make_immutable (funcs);
-#ifdef HB_USE_ATEXIT
+#if HB_USE_ATEXIT
atexit (free_static_ot_funcs);
#endif
@@ -277,7 +277,7 @@ static struct hb_ot_font_funcs_lazy_loader_t : hb_font_funcs_lazy_loader_t<hb_ot
}
} static_ot_funcs;
-#ifdef HB_USE_ATEXIT
+#if HB_USE_ATEXIT
static
void free_static_ot_funcs (void)
{
diff --git a/src/hb-shape.cc b/src/hb-shape.cc
index 270da3d7..45f3a691 100644
--- a/src/hb-shape.cc
+++ b/src/hb-shape.cc
@@ -48,7 +48,7 @@
**/
-#ifdef HB_USE_ATEXIT
+#if HB_USE_ATEXIT
static void free_static_shaper_list (void);
#endif
@@ -69,7 +69,7 @@ static struct hb_shaper_list_lazy_loader_t : hb_lazy_loader_t<const char *,
shaper_list[i] = shapers[i].name;
shaper_list[i] = nullptr;
-#ifdef HB_USE_ATEXIT
+#if HB_USE_ATEXIT
atexit (free_static_shaper_list);
#endif
@@ -85,7 +85,7 @@ static struct hb_shaper_list_lazy_loader_t : hb_lazy_loader_t<const char *,
}
} static_shaper_list;
-#ifdef HB_USE_ATEXIT
+#if HB_USE_ATEXIT
static
void free_static_shaper_list (void)
{
diff --git a/src/hb-shaper.cc b/src/hb-shaper.cc
index abea544f..b10927ec 100644
--- a/src/hb-shaper.cc
+++ b/src/hb-shaper.cc
@@ -35,7 +35,7 @@ static const hb_shaper_entry_t all_shapers[] = {
#undef HB_SHAPER_IMPLEMENT
};
-#ifdef HB_USE_ATEXIT
+#if HB_USE_ATEXIT
static void free_static_shapers (void);
#endif
@@ -80,7 +80,7 @@ static struct hb_shapers_lazy_loader_t : hb_lazy_loader_t<const hb_shaper_entry_
p = end + 1;
}
-#ifdef HB_USE_ATEXIT
+#if HB_USE_ATEXIT
atexit (free_static_shapers);
#endif
@@ -96,7 +96,7 @@ static struct hb_shapers_lazy_loader_t : hb_lazy_loader_t<const hb_shaper_entry_
}
} static_shapers;
-#ifdef HB_USE_ATEXIT
+#if HB_USE_ATEXIT
static
void free_static_shapers (void)
{
diff --git a/src/hb-ucdn.cc b/src/hb-ucdn.cc
index 3179683c..10608aff 100644
--- a/src/hb-ucdn.cc
+++ b/src/hb-ucdn.cc
@@ -222,7 +222,7 @@ hb_ucdn_decompose(hb_unicode_funcs_t *ufuncs HB_UNUSED,
}
-#ifdef HB_USE_ATEXIT
+#if HB_USE_ATEXIT
static void free_static_ucdn_funcs (void);
#endif
@@ -241,7 +241,7 @@ static struct hb_ucdn_unicode_funcs_lazy_loader_t : hb_unicode_funcs_lazy_loader
hb_unicode_funcs_make_immutable (funcs);
-#ifdef HB_USE_ATEXIT
+#if HB_USE_ATEXIT
atexit (free_static_ucdn_funcs);
#endif
@@ -249,7 +249,7 @@ static struct hb_ucdn_unicode_funcs_lazy_loader_t : hb_unicode_funcs_lazy_loader
}
} static_ucdn_funcs;
-#ifdef HB_USE_ATEXIT
+#if HB_USE_ATEXIT
static
void free_static_ucdn_funcs (void)
{
diff --git a/src/hb-uniscribe.cc b/src/hb-uniscribe.cc
index 1331704e..1fae6435 100644
--- a/src/hb-uniscribe.cc
+++ b/src/hb-uniscribe.cc
@@ -245,7 +245,7 @@ static struct hb_uniscribe_shaper_funcs_lazy_loader_t : hb_lazy_loader_t<hb_unis
funcs->init ();
-#ifdef HB_USE_ATEXIT
+#if HB_USE_ATEXIT
atexit (free_static_uniscribe_shaper_funcs);
#endif
@@ -261,7 +261,7 @@ static struct hb_uniscribe_shaper_funcs_lazy_loader_t : hb_lazy_loader_t<hb_unis
}
} static_uniscribe_shaper_funcs;
-#ifdef HB_USE_ATEXIT
+#if HB_USE_ATEXIT
static
void free_static_uniscribe_shaper_funcs (void)
{
diff --git a/src/hb.hh b/src/hb.hh
index 16ccf87c..8c12b91c 100644
--- a/src/hb.hh
+++ b/src/hb.hh
@@ -281,7 +281,7 @@ static int errno = 0; /* Use something better? */
# endif
#endif
-#if HAVE_ATEXIT
+#if defined(HAVE_ATEXIT) && !defined(HB_USE_ATEXIT)
/* atexit() is only safe to be called from shared libraries on certain
* platforms. Whitelist.
* https://bugs.freedesktop.org/show_bug.cgi?id=82246 */
@@ -313,6 +313,9 @@ static int errno = 0; /* Use something better? */
#ifdef HB_NO_ATEXIT
# undef HB_USE_ATEXIT
#endif
+#ifndef HB_USE_ATEXIT
+# define HB_USE_ATEXIT 0
+#endif
#define HB_STMT_START do
#define HB_STMT_END while (0)
More information about the HarfBuzz
mailing list