commit | bda3238c89fa4673c8772ad02f1949fc19b41a5e | [log] [tgz] |
---|---|---|
author | Behdad Esfahbod <behdad@behdad.org> | Tue Sep 14 08:12:48 2021 -0400 |
committer | Behdad Esfahbod <behdad@behdad.org> | Tue Sep 14 08:12:48 2021 -0400 |
tree | 6073295e6369d3636566d48a1db0ae928c1a0799 | |
parent | 9c270451581a0d7e969c29d65a9ba62b6b7b9b12 [diff] [blame] |
Add fallback atexit implementation using template descrutors Fixes https://github.com/harfbuzz/harfbuzz/issues/3197
diff --git a/src/hb.hh b/src/hb.hh index 4ba46ea..7c72179 100644 --- a/src/hb.hh +++ b/src/hb.hh
@@ -449,7 +449,8 @@ # ifdef HAVE_ATEXIT # define hb_atexit atexit # else -# error "atexit not found." + template <void (*function) (void)> struct hb_atexit_t { ~hb_atexit_t () { function (); } }; +# define hb_atexit(f) static hb_atexit_t<f> _hb_atexit_##__LINE__; # endif #endif