aboutsummaryrefslogtreecommitdiff
path: root/gcc/libgcc2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/libgcc2.c')
-rw-r--r--gcc/libgcc2.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c
index 106a444..7c26e6b 100644
--- a/gcc/libgcc2.c
+++ b/gcc/libgcc2.c
@@ -3003,9 +3003,17 @@ exit (int status)
_exit (status);
}
-#else
+#else /* ON_EXIT defined */
int _exit_dummy_decl = 0; /* prevent compiler & linker warnings */
-#endif
+
+# ifndef HAVE_ATEXIT
+/* Provide a fake for atexit() using ON_EXIT. */
+int atexit (func_ptr func)
+{
+ return ON_EXIT (func, NULL);
+}
+# endif /* HAVE_ATEXIT */
+#endif /* ON_EXIT defined */
#endif /* L_exit */