]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libgcc2.c (L_exit): Provide a fake for atexit on systems which define ON_EXIT but...
authorManfred Hollstein <manfred@s-direktnet.de>
Mon, 6 Jul 1998 23:52:21 +0000 (23:52 +0000)
committerJeff Law <law@gcc.gnu.org>
Mon, 6 Jul 1998 23:52:21 +0000 (17:52 -0600)
        * libgcc2.c (L_exit): Provide a fake for atexit on systems which
        define ON_EXIT but not HAVE_ATEXIT.

From-SVN: r20982

gcc/ChangeLog
gcc/libgcc2.c

index a3801deaaf8ce2507506532bc69fce09d54e8c2e..01affd1bcabc7c5b657525d41e4d7f0ec29390c2 100644 (file)
@@ -1,3 +1,8 @@
+Tue Jul  7 00:50:17 1998  Manfred Hollstein   (manfred@s-direktnet.de)
+
+        * libgcc2.c (L_exit): Provide a fake for atexit on systems which
+        define ON_EXIT but not HAVE_ATEXIT.
+
 Tue Jul  7 00:44:35 1998  Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
 
        * m68k.md (zero_extend QI to HI): Correctly handle TARGET_5200.
index 106a444f79c624ec55d242f7e44160f4eed17561..7c26e6bc94673f06bc644e3d618fe2ff8a33ec4d 100644 (file)
@@ -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 */
 \f