Include the fortran library sources from GCC 3.4.4.
[dragonfly.git] / contrib / gcc-3.4 / libf2c / libF77 / F77_aloc.c
1 #include "f2c.h"
2 #undef abs
3 #undef min
4 #undef max
5 #include <stdio.h>
6
7 static integer memfailure = 3;
8
9 #include <stdlib.h>
10 extern void G77_exit_0 (integer *);
11
12 char *
13 F77_aloc (integer Len, char *whence)
14 {
15   char *rv;
16   unsigned int uLen = (unsigned int) Len;       /* for K&R C */
17
18   if (!(rv = (char *) malloc (uLen)))
19     {
20       fprintf (stderr, "malloc(%u) failure in %s\n", uLen, whence);
21       G77_exit_0 (&memfailure);
22     }
23   return rv;
24 }