Declare malloc, free, and atexit if inhibit_libc is defined.
authorMichael Meissner <meissner@cygnus.com>
Tue, 5 Oct 1999 19:41:35 +0000 (19:41 +0000)
committerMichael Meissner <meissner@gcc.gnu.org>
Tue, 5 Oct 1999 19:41:35 +0000 (19:41 +0000)
From-SVN: r29829

gcc/ChangeLog
gcc/frame.c
gcc/libgcc2.c

index 0da5b3a7fd9391216301f13719e440cdfa1102d6..46dec8b7d6f05915d8f470799d805f4b626ed9b7 100644 (file)
@@ -1,3 +1,11 @@
+Tue Oct  5 15:37:04 1999  Michael Meissner  <meissner@cygnus.com>
+
+       * libgcc2.c (toplevel): If inhibit_libc is defined, declare
+       malloc, free, and atexit.  Don't include stddef.h twice.
+
+       * frame.c (toplevel): If inhibit_libc is defined, declare
+       malloc and free.
+
 Tue Oct  5 12:00:32 1999  Richard Henderson  <rth@cygnus.com>
 
        * flow.c (make_edge): Accept an optional 2D bitmap in which
index b5f643e7043774907134600410eaab0507bb7a1f..d1539602206163fb0b11df390fee1b5258abad48 100644 (file)
@@ -1,6 +1,6 @@
 /* Subroutines needed for unwinding stack frames for exception handling.  */
 /* Compile this one with gcc.  */
-/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
    Contributed by Jason Merrill <jason@cygnus.com>.
 
 This file is part of GNU CC.
@@ -41,6 +41,15 @@ Boston, MA 02111-1307, USA.  */
 /* fixproto guarantees these system headers exist. */
 #include <stdlib.h>
 #include <unistd.h>
+
+#else
+#include <stddef.h>
+#ifndef malloc
+extern void *malloc (size_t);
+#endif
+#ifndef free
+extern void free (void *);
+#endif
 #endif
 
 #include "defaults.h"
index 777112ce4e4a11ac9c1c23fd9621b1d241450c71..0cf8c5ce1aa605cf4496819b76fb8932dd8bca58 100644 (file)
@@ -40,11 +40,23 @@ Boston, MA 02111-1307, USA.  */
 /* fixproto guarantees these system headers exist. */
 #include <stdlib.h>
 #include <unistd.h>
+
+#else
+#include <stddef.h>
+#ifndef malloc
+extern void *malloc (size_t);
+#endif
+#ifndef free
+extern void free (void *);
+#endif
+#ifndef atexit
+extern int atexit(void (*)(void));
+#endif
 #endif
 
 #include "machmode.h"
 #include "defaults.h" 
-#ifndef L_trampoline
+#if !defined(L_trampoline) && !defined(inhibit_libc)
 #include <stddef.h>
 #endif