X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/23e20b0053d7317ce3facd3fd38db8c73c2c380a..HEAD:/stdlib/FreeBSD/exit.c?ds=sidebyside diff --git a/stdlib/FreeBSD/exit.c b/stdlib/FreeBSD/exit.c index e61834e..03d8c09 100644 --- a/stdlib/FreeBSD/exit.c +++ b/stdlib/FreeBSD/exit.c @@ -27,6 +27,9 @@ * SUCH DAMAGE. */ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wstrict-prototypes" + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)exit.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ @@ -55,3 +58,12 @@ extern void _tlv_exit(); void exit(int status) { +#if !TARGET_IPHONE_SIMULATOR && (__i386__ || __x86_64__) + _tlv_exit(); // C++11 requires thread_local objects to be destroyed before global objects +#endif + __cxa_finalize(NULL); + if (__cleanup) + (*__cleanup)(); + __exit(status); +} +#pragma clang diagnostic pop