f77_aloc.c

来自「DTMK软件开发包,此为开源软件,是一款很好的医学图像开发资源.」· C语言 代码 · 共 45 行

C
45
字号
#include "v3p_f2c.h"
#undef abs
#undef min
#undef max
#include "stdio.h"

static integer memfailure = 3;

#ifdef KR_headers
extern char *malloc();
extern void exit_();

 char *
F77_aloc(Len, whence) integer Len; char *whence;
#else
#include "stdlib.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
extern "C" {
#endif
extern void exit_(integer*);
#ifdef __cplusplus
        }
#endif

 char *
F77_aloc(integer Len, char *whence)
#endif
{
        char *rv;
        unsigned int uLen = (unsigned int) Len; /* for K&R C */

        if (!(rv = (char*)malloc(uLen))) {
                fprintf(stderr, "malloc(%u) failure in %s\n",
                        uLen, whence);
                exit_(&memfailure);
                }
        return rv;
        }
#ifdef __cplusplus
}
#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?