Add fallback atexit implementation using template descrutors
Fixes https://github.com/harfbuzz/harfbuzz/issues/3197
This commit is contained in:
parent
9c27045158
commit
bda3238c89
|
@ -449,7 +449,8 @@ static int HB_UNUSED _hb_errno = 0;
|
||||||
# ifdef HAVE_ATEXIT
|
# ifdef HAVE_ATEXIT
|
||||||
# define hb_atexit atexit
|
# define hb_atexit atexit
|
||||||
# else
|
# 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
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue