summaryrefslogtreecommitdiff
path: root/libiberty/xmalloc.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1999-04-15 22:05:35 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1999-04-15 22:05:35 +0000
commitb01c09558217c492df5eeab3506b2179a2bda8bc (patch)
tree0ee0d2463aa466f8760f6e1c1f676361d5e55672 /libiberty/xmalloc.c
parent378ac6605dde842d47f8d210af6b046e7bcb1dcd (diff)
downloadgcc-b01c09558217c492df5eeab3506b2179a2bda8bc.tar.gz
* configure.in (checkfuncs): Check for sbrk.
* config.in: Rebuilt. * configure: Likewise. * xmalloc.c: Use HAVE_SBRK instead of the host specific definitions. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@26480 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty/xmalloc.c')
-rw-r--r--libiberty/xmalloc.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/libiberty/xmalloc.c b/libiberty/xmalloc.c
index 1bc15c99cd6..be25c5aca19 100644
--- a/libiberty/xmalloc.c
+++ b/libiberty/xmalloc.c
@@ -43,22 +43,22 @@ PTR sbrk PARAMS ((ptrdiff_t));
/* The program name if set. */
static const char *name = "";
-#if ! defined (_WIN32) || defined (__CYGWIN__) || defined (_UWIN)
+#ifdef HAVE_SBRK
/* The initial sbrk, set when the program name is set. Not used for win32
ports other than cygwin32. */
static char *first_break = NULL;
-#endif /* ! _WIN32 || __CYGWIN__ || _UWIN */
+#endif /* HAVE_SBRK */
void
xmalloc_set_program_name (s)
const char *s;
{
name = s;
-#if ! defined (_WIN32) || defined (__CYGWIN__) || defined (_UWIN)
+#ifdef HAVE_SBRK
/* Win32 ports other than cygwin32 don't have brk() */
if (first_break == NULL)
first_break = (char *) sbrk (0);
-#endif /* ! _WIN32 || __CYGWIN__ || _UWIN */
+#endif /* HAVE_SBRK */
}
PTR
@@ -72,7 +72,7 @@ xmalloc (size)
newmem = malloc (size);
if (!newmem)
{
-#if ! defined (_WIN32) || defined (__CYGWIN__) || defined (_UWIN)
+#ifdef HAVE_SBRK
extern char **environ;
size_t allocated;
@@ -84,12 +84,12 @@ xmalloc (size)
"\n%s%sCan not allocate %lu bytes after allocating %lu bytes\n",
name, *name ? ": " : "",
(unsigned long) size, (unsigned long) allocated);
-#else
+#else /* HAVE_SBRK */
fprintf (stderr,
"\n%s%sCan not allocate %lu bytes\n",
name, *name ? ": " : "",
(unsigned long) size);
-#endif /* ! _WIN32 || __CYGWIN__ || _UWIN */
+#endif /* HAVE_SBRK */
xexit (1);
}
return (newmem);
@@ -107,7 +107,7 @@ xcalloc (nelem, elsize)
newmem = calloc (nelem, elsize);
if (!newmem)
{
-#if ! defined (_WIN32) || defined (__CYGWIN__) || defined (_UWIN)
+#ifdef HAVE_SBRK
extern char **environ;
size_t allocated;
@@ -119,12 +119,12 @@ xcalloc (nelem, elsize)
"\n%s%sCan not allocate %lu bytes after allocating %lu bytes\n",
name, *name ? ": " : "",
(unsigned long) (nelem * elsize), (unsigned long) allocated);
-#else
+#else /* HAVE_SBRK */
fprintf (stderr,
"\n%s%sCan not allocate %lu bytes\n",
name, *name ? ": " : "",
(unsigned long) (nelem * elsize));
-#endif /* ! _WIN32 || __CYGWIN__ || _UWIN */
+#endif /* HAVE_SBRK */
xexit (1);
}
return (newmem);
@@ -145,7 +145,7 @@ xrealloc (oldmem, size)
newmem = realloc (oldmem, size);
if (!newmem)
{
-#if ! defined (_WIN32) || defined (__CYGWIN__) || defined (_UWIN)
+#ifdef HAVE_SBRK
extern char **environ;
size_t allocated;
@@ -157,12 +157,12 @@ xrealloc (oldmem, size)
"\n%s%sCan not reallocate %lu bytes after allocating %lu bytes\n",
name, *name ? ": " : "",
(unsigned long) size, (unsigned long) allocated);
-#else /* ! _WIN32 || __CYGWIN__ || _UWIN */
+#else /* HAVE_SBRK */
fprintf (stderr,
"\n%s%sCan not reallocate %lu bytes\n",
name, *name ? ": " : "",
(unsigned long) size);
-#endif /* ! _WIN32 || __CYGWIN__ || _UWIN */
+#endif /* HAVE_SBRK */
xexit (1);
}
return (newmem);