errno.c

来自「微软的基于HMM的人脸识别原代码, 非常经典的说」· C语言 代码 · 共 50 行

C
50
字号
/* errno.c
 *
 *	(C) Copyright Dec 20 1998, Edmond J. Breen.
 *		   ALL RIGHTS RESERVED.
 * This code may be copied for personal, non-profit use only.
 *
 */

#ifndef NO_ERRNO

#include <errno.h>
#include <stdlib.h>
#include "eic.h"
#include "stdliblocal.h"


val_t _get_errno(void)
{
    val_t v;
    /*
     * This function exists so that EiC can get the address 
     * of the errno;
     */
    
    errno = 0;
    v.p.sp = v.p.p = &errno;
    v.p.ep = (void *) ( ((char *) v.p.p) + sizeof( errno ) );
    return v;
}


#endif

/*************************************/

void module_errno()
{
#ifndef NO_ERRNO

    /* ERRNO.H STUFF */
    EiC_add_builtinfunc("_get_errno",_get_errno);

#endif
}





⌨️ 快捷键说明

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