From c2fc7e5a10f4f0d10bbbd327b33cd5d8f3cd03b6 Mon Sep 17 00:00:00 2001 From: ghazi Date: Wed, 29 Dec 1999 21:22:16 +0000 Subject: * crtstuff.c: If !inhibit_libc, include stdlib.h/unistd.h. Otherwise provide a declaration for atexit. (init_dummy): Make sure dummy call to atexit is nevertheless called with correct number of args. * frame.c: Update comments referring to other files. * libgcc2.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31124 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/crtstuff.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'gcc/crtstuff.c') diff --git a/gcc/crtstuff.c b/gcc/crtstuff.c index c0a6ae02ffd..98e0779a5e2 100644 --- a/gcc/crtstuff.c +++ b/gcc/crtstuff.c @@ -52,6 +52,21 @@ Boston, MA 02111-1307, USA. */ do not apply. */ #include "tm.h" + +/* We disable this when inhibit_libc, so that gcc can still be built without + needing header files first. */ +/* ??? This is not a good solution, since prototypes may be required in + some cases for correct code. See also libgcc2.c/frame.c. */ +#ifndef inhibit_libc +/* fixproto guarantees these system headers exist. */ +#include +#include +#else +# ifndef atexit +extern int atexit(void (*)(void)); +# endif +#endif + #include "defaults.h" #include #include "frame.h" @@ -403,7 +418,7 @@ init_dummy (void) extern char **__environ; ___brk_addr = __environ; - atexit (); + atexit (0); } #endif } -- cgit v1.2.1