Daily bump.
[official-gcc.git] / libf2c / libF77 / F77_aloc.c
blobe329a1bfb3415847d8fe3e60cfd5e06f775f9b25
1 #include "f2c.h"
2 #undef abs
3 #undef min
4 #undef max
5 #include <stdio.h>
7 static integer memfailure = 3;
9 #ifdef KR_headers
10 extern char *malloc();
11 extern void G77_exit_0 ();
13 char *
14 F77_aloc(Len, whence) integer Len; char *whence;
15 #else
16 #include <stdlib.h>
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 extern void G77_exit_0 (integer*);
21 #ifdef __cplusplus
23 #endif
25 char *
26 F77_aloc(integer Len, char *whence)
27 #endif
29 char *rv;
30 unsigned int uLen = (unsigned int) Len; /* for K&R C */
32 if (!(rv = (char*)malloc(uLen))) {
33 fprintf(stderr, "malloc(%u) failure in %s\n",
34 uLen, whence);
35 G77_exit_0 (&memfailure);
37 return rv;