c@427: #include "f2c.h" c@427: #undef abs c@427: #undef min c@427: #undef max c@427: #include "stdio.h" c@427: c@427: static integer memfailure = 3; c@427: c@427: #ifdef KR_headers c@427: extern char *malloc(); c@427: extern void exit_(); c@427: c@427: char * c@427: F77_aloc(Len, whence) integer Len; char *whence; c@427: #else c@427: #include "stdlib.h" c@427: #ifdef __cplusplus c@427: extern "C" { c@427: #endif c@427: #ifdef __cplusplus c@427: extern "C" { c@427: #endif c@427: extern void exit_(integer*); c@427: #ifdef __cplusplus c@427: } c@427: #endif c@427: c@427: char * c@427: F77_aloc(integer Len, const char *whence) c@427: #endif c@427: { c@427: char *rv; c@427: unsigned int uLen = (unsigned int) Len; /* for K&R C */ c@427: c@427: if (!(rv = (char*)malloc(uLen))) { c@427: fprintf(stderr, "malloc(%u) failure in %s\n", c@427: uLen, whence); c@427: exit_(&memfailure); c@427: } c@427: return rv; c@427: } c@427: #ifdef __cplusplus c@427: } c@427: #endif