summaryrefslogtreecommitdiff
path: root/libiberty/objalloc.c
diff options
context:
space:
mode:
authorZack Weinberg <zackw@panix.com>2000-05-29 20:45:32 +0000
committerZack Weinberg <zackw@panix.com>2000-05-29 20:45:32 +0000
commit6aa3a8a5d23c6c4498fe80fd1b944685f9ba0cdd (patch)
treeb409d7e5a81b20cab680a0c1cc93f9108132cc35 /libiberty/objalloc.c
parent474ddc1ba7e55d367221262792fe6fac77293881 (diff)
downloadgdb-6aa3a8a5d23c6c4498fe80fd1b944685f9ba0cdd.tar.gz
* hashtab.c, partition.c, xmemdup.c: Include string.h
if HAVE_STRING_H. * pexecute.c, xexit.c: Include stdlib.h if HAVE_STDLIB_H. * objalloc.c: Include config.h. Include stdlib.h and don't declare malloc or free if HAVE_STDLIB_H. * strerror.c, strsignal.c: Include stdlib.h if HAVE_STDLIB_H, else declare malloc without prototype. Include string.h if HAVE_STRING_H, else declare memset without prototype. Don't include stddef.h. * sort.c: Bring over from GCC.
Diffstat (limited to 'libiberty/objalloc.c')
-rw-r--r--libiberty/objalloc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libiberty/objalloc.c b/libiberty/objalloc.c
index 57754a86105..50995691e33 100644
--- a/libiberty/objalloc.c
+++ b/libiberty/objalloc.c
@@ -18,6 +18,8 @@ Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "ansidecl.h"
+#include "config.h"
+
#include "objalloc.h"
/* Get a definition for NULL. */
@@ -33,11 +35,16 @@ Boston, MA 02111-1307, USA. */
#include <stddef.h>
#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#else
/* For systems with larger pointers than ints, this must be declared. */
extern PTR malloc PARAMS ((size_t));
extern void free PARAMS ((PTR));
#endif
+#endif
+
/* These routines allocate space for an object. Freeing allocated
space may or may not free all more recently allocated space.