annotate ext/clapack/src/f77_aloc.c @ 492:2892ecc40f86

And cstdlib
author Chris Cannam <cannam@all-day-breakfast.com>
date Fri, 31 May 2019 16:55:25 +0100
parents 905e45637745
children
rev   line source
c@427 1 #include "f2c.h"
c@427 2 #undef abs
c@427 3 #undef min
c@427 4 #undef max
c@427 5 #include "stdio.h"
c@427 6
c@427 7 static integer memfailure = 3;
c@427 8
c@427 9 #ifdef KR_headers
c@427 10 extern char *malloc();
c@427 11 extern void exit_();
c@427 12
c@427 13 char *
c@427 14 F77_aloc(Len, whence) integer Len; char *whence;
c@427 15 #else
c@427 16 #include "stdlib.h"
c@427 17 #ifdef __cplusplus
c@427 18 extern "C" {
c@427 19 #endif
c@427 20 #ifdef __cplusplus
c@427 21 extern "C" {
c@427 22 #endif
c@427 23 extern void exit_(integer*);
c@427 24 #ifdef __cplusplus
c@427 25 }
c@427 26 #endif
c@427 27
c@427 28 char *
c@427 29 F77_aloc(integer Len, const char *whence)
c@427 30 #endif
c@427 31 {
c@427 32 char *rv;
c@427 33 unsigned int uLen = (unsigned int) Len; /* for K&R C */
c@427 34
c@427 35 if (!(rv = (char*)malloc(uLen))) {
c@427 36 fprintf(stderr, "malloc(%u) failure in %s\n",
c@427 37 uLen, whence);
c@427 38 exit_(&memfailure);
c@427 39 }
c@427 40 return rv;
c@427 41 }
c@427 42 #ifdef __cplusplus
c@427 43 }
c@427 44 #endif