summaryrefslogtreecommitdiff
path: root/libiberty/xmalloc.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2005-05-24 21:01:33 +0000
committerDJ Delorie <dj@redhat.com>2005-05-24 21:01:33 +0000
commitabf6a75b428517d9caaf9155212b0b10e0379a99 (patch)
tree3476694dba1d2c731deb2a131b0d8d6c5dcb0cd3 /libiberty/xmalloc.c
parentf127898a4db12540b9898e25777c6c3725d119bf (diff)
downloadbinutils-gdb-abf6a75b428517d9caaf9155212b0b10e0379a99.tar.gz
merge from gcc
Diffstat (limited to 'libiberty/xmalloc.c')
-rw-r--r--libiberty/xmalloc.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/libiberty/xmalloc.c b/libiberty/xmalloc.c
index adba5188df3..3e97aab563f 100644
--- a/libiberty/xmalloc.c
+++ b/libiberty/xmalloc.c
@@ -75,11 +75,23 @@ function will be called to print an error message and terminate execution.
#include <unixlib.h>
#else
/* For systems with larger pointers than ints, these must be declared. */
-PTR malloc (size_t);
-PTR realloc (PTR, size_t);
-PTR calloc (size_t, size_t);
-PTR sbrk (ptrdiff_t);
-#endif
+# if HAVE_STDLIB_H && HAVE_UNISTD_H && HAVE_DECL_MALLOC \
+ && HAVE_DECL_REALLOC && HAVE_DECL_CALLOC && HAVE_DECL_SBRK
+# include <stdlib.h>
+# include <unistd.h>
+# else
+# ifdef __cplusplus
+extern "C" {
+# endif /* __cplusplus */
+void *malloc (size_t);
+void *realloc (void *, size_t);
+void *calloc (size_t, size_t);
+void *sbrk (ptrdiff_t);
+# ifdef __cplusplus
+}
+# endif /* __cplusplus */
+# endif /* HAVE_STDLIB_H ... */
+#endif /* VMS */
/* The program name if set. */
static const char *name = "";