2003-05-14 Eric Christopher <echristo@redhat.com>
[official-gcc.git] / libf2c / libF77 / F77_aloc.c
blobb28610291980b185bc8f8f4dbf33fce9c73bf281
1 #include "f2c.h"
2 #undef abs
3 #undef min
4 #undef max
5 #include <stdio.h>
7 static integer memfailure = 3;
9 #include <stdlib.h>
10 extern void G77_exit_0 (integer *);
12 char *
13 F77_aloc (integer Len, char *whence)
15 char *rv;
16 unsigned int uLen = (unsigned int) Len; /* for K&R C */
18 if (!(rv = (char *) malloc (uLen)))
20 fprintf (stderr, "malloc(%u) failure in %s\n", uLen, whence);
21 G77_exit_0 (&memfailure);
23 return rv;