From bceb30e77bd19db8debc5182b75018c169acd6ff Mon Sep 17 00:00:00 2001 From: Manfred Hollstein Date: Mon, 6 Jul 1998 23:52:21 +0000 Subject: [PATCH] libgcc2.c (L_exit): Provide a fake for atexit on systems which define ON_EXIT but not HAVE_ATEXIT. * libgcc2.c (L_exit): Provide a fake for atexit on systems which define ON_EXIT but not HAVE_ATEXIT. From-SVN: r20982 --- gcc/ChangeLog | 5 +++++ gcc/libgcc2.c | 12 ++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a3801deaaf8c..01affd1bcabc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 * m68k.md (zero_extend QI to HI): Correctly handle TARGET_5200. diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c index 106a444f79c6..7c26e6bc9467 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 */