From e8859fca3eafb5aab6d029563b31219ccca0d673 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Sun, 4 Feb 2018 01:26:57 +0700 Subject: [PATCH] Enable use of atexit() on macOS and related platforms. The atexit() man page indicates that this is expected to behave in the expected way on unloading of shared libraries. --- src/hb-private.hh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/hb-private.hh b/src/hb-private.hh index 62c9fb278..eba797cfc 100644 --- a/src/hb-private.hh +++ b/src/hb-private.hh @@ -221,6 +221,12 @@ static int errno = 0; /* Use something better? */ * https://developer.android.com/tools/sdk/ndk/index.html */ # define HB_USE_ATEXIT 1 +# elif defined(__APPLE__) +/* For macOS and related platforms, the atexit man page indicates + * that it will be invoked when the library is unloaded, not only + * at application exit. + */ +# define HB_USE_ATEXIT 1 # endif #endif