summaryrefslogtreecommitdiff
path: root/thirdparty/harfbuzz/src/hb-shaper.cc
diff options
context:
space:
mode:
Diffstat (limited to 'thirdparty/harfbuzz/src/hb-shaper.cc')
-rw-r--r--thirdparty/harfbuzz/src/hb-shaper.cc16
1 files changed, 5 insertions, 11 deletions
diff --git a/thirdparty/harfbuzz/src/hb-shaper.cc b/thirdparty/harfbuzz/src/hb-shaper.cc
index 0ea68ad1f5..a11ed83afd 100644
--- a/thirdparty/harfbuzz/src/hb-shaper.cc
+++ b/thirdparty/harfbuzz/src/hb-shaper.cc
@@ -38,9 +38,7 @@ static const hb_shaper_entry_t all_shapers[] = {
static_assert (0 != ARRAY_LENGTH_CONST (all_shapers), "No shaper enabled.");
#endif
-#if HB_USE_ATEXIT
-static void free_static_shapers ();
-#endif
+static inline void free_static_shapers ();
static struct hb_shapers_lazy_loader_t : hb_lazy_loader_t<const hb_shaper_entry_t,
hb_shapers_lazy_loader_t>
@@ -51,7 +49,7 @@ static struct hb_shapers_lazy_loader_t : hb_lazy_loader_t<const hb_shaper_entry_
if (!env || !*env)
return nullptr;
- hb_shaper_entry_t *shapers = (hb_shaper_entry_t *) calloc (1, sizeof (all_shapers));
+ hb_shaper_entry_t *shapers = (hb_shaper_entry_t *) hb_calloc (1, sizeof (all_shapers));
if (unlikely (!shapers))
return nullptr;
@@ -83,23 +81,19 @@ static struct hb_shapers_lazy_loader_t : hb_lazy_loader_t<const hb_shaper_entry_
p = end + 1;
}
-#if HB_USE_ATEXIT
- atexit (free_static_shapers);
-#endif
+ hb_atexit (free_static_shapers);
return shapers;
}
- static void destroy (const hb_shaper_entry_t *p) { free ((void *) p); }
+ static void destroy (const hb_shaper_entry_t *p) { hb_free ((void *) p); }
static const hb_shaper_entry_t *get_null () { return all_shapers; }
} static_shapers;
-#if HB_USE_ATEXIT
-static
+static inline
void free_static_shapers ()
{
static_shapers.free_instance ();
}
-#endif
const hb_shaper_entry_t *
_hb_shapers_get ()