From 9177953720e2d10e8db47c079563d8656d6f5553 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 4 Feb 2022 12:38:45 -0600 Subject: [PATCH] [atexit] Allow hb_atexit redefinition Fixes https://github.com/harfbuzz/harfbuzz/issues/3412 --- src/hb.hh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/hb.hh b/src/hb.hh index 1f1426752..b9f5f7141 100644 --- a/src/hb.hh +++ b/src/hb.hh @@ -447,6 +447,7 @@ static int HB_UNUSED _hb_errno = 0; #ifndef HB_USE_ATEXIT # define HB_USE_ATEXIT 0 #endif +#ifndef hb_atexit #if !HB_USE_ATEXIT # define hb_atexit(_) HB_STMT_START { if (0) (_) (); } HB_STMT_END #else /* HB_USE_ATEXIT */ @@ -457,6 +458,7 @@ static int HB_UNUSED _hb_errno = 0; # define hb_atexit(f) static hb_atexit_t _hb_atexit_##__LINE__; # endif #endif +#endif /* Lets assert int types. Saves trouble down the road. */ static_assert ((sizeof (hb_codepoint_t) == 4), "");