aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1996-03-04 18:45:47 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1996-03-04 18:45:47 -0500
commita3a55d6a3837496a226fc7d4d6aced6ee441365e (patch)
treef255be35a884f3738b12cbe595990118078d08e5 /gcc
parent948260f6fe2cff2fdf53df511feb09b58edfc86a (diff)
downloadgcc-a3a55d6a3837496a226fc7d4d6aced6ee441365e.zip
gcc-a3a55d6a3837496a226fc7d4d6aced6ee441365e.tar.gz
gcc-a3a55d6a3837496a226fc7d4d6aced6ee441365e.tar.bz2
(HAVE_ATEXIT): Define if NEED_ATEXIT is defined.
(atexit): Use `int atexit' prototype also if NEED_ATEXIT is defined. (on_exit): According to man on_exit on the Sun it returns int not void. From-SVN: r11431
Diffstat (limited to 'gcc')
-rw-r--r--gcc/gbl-ctors.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/gbl-ctors.h b/gcc/gbl-ctors.h
index 537df50..7c17aea 100644
--- a/gcc/gbl-ctors.h
+++ b/gcc/gbl-ctors.h
@@ -2,7 +2,7 @@
for getting g++ file-scope static objects constructed. This file
will get included either by libgcc2.c (for systems that don't support
a .init section) or by crtstuff.c (for those that do).
- Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
Contributed by Ron Guilmette (rfg@segfault.us.com)
This file is part of GNU CC.
@@ -30,8 +30,14 @@ Boston, MA 02111-1307, USA. */
Note that this file should only be compiled with GCC.
*/
+#ifdef NEED_ATEXIT
+#ifndef HAVE_ATEXIT
+#define HAVE_ATEXIT 1 /* Take it from libgcc2.c */
+#endif
+#endif
+
#ifdef HAVE_ATEXIT
-#ifdef WINNT
+#if defined (WINNT) || defined (NEED_ATEXIT)
extern int atexit (void (*) (void));
#else
extern void atexit (void (*) (void));
@@ -39,7 +45,7 @@ extern void atexit (void (*) (void));
#define ON_EXIT(FUNC,ARG) atexit ((FUNC))
#else
#ifdef sun
-extern void on_exit (void*, void*);
+extern int on_exit (void*, void*); /* The man page says it returns int. */
#define ON_EXIT(FUNC,ARG) on_exit ((FUNC), (ARG))
#endif
#endif