⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wccomp.c

📁 这是一个符合posix.13 pse51的实时内核
💻 C
字号:
/* Project: 	HARTIK 3.0      				*/
/* Description: Hard Real TIme Kernel for 386 & higher machines */
/* Author:	Gerardo Lamastra				*/
/* Date:	9/5/96 						*/
/* Revision:	2.0/WC						*/

/* File: WC-Conv.C			   		  */
/* Watcom-C Quirks					  */

#include <xsys.h>
#include <mem.h>
#include <cons.h>
#include <math.h>

/* Check for coprocessor */
DWORD _8087 = 1;

/* Stdliv error! */
errno = 0;

/* Another Watcom strange trick! They detect the Pentium Fdiv bug in some */
/* tricky way I really don't know and use some strange functions defined  */
/* into their "standard" library!					  */

DWORD _chipbug = 0;

void __cdecl _fprem_chk(void)
{
    /* Hopefully No Wrongo Pentium! */
}

void __cdecl _fptan_chk(void)
{
    /* Hopefully No Wrongo Pentium! */
}

void __cdecl _fdiv_fpr(void)
{
    /* Hopefully No Wrongo Pentium! */
}

extern  int     __matherr( struct exception * );
#pragma aux     __matherr "*";

static char *Msgs[] = {
        0,
        "Domain error",
        "Argument singularity",
        "Overflow range error",
        "Underflow range error",
        "Total loss of significance",
        "Partial loss of significance"
   };

int (*__MathErrRtn)(struct exception *) = __matherr;  

double _matherr(struct exception *excp)
{
    if ((*__MathErrRtn)(excp) == 0) {
	cputs(Msgs[excp->type]);
	cputs(" in ");
	cputs(excp->name);
	NL();
    }
    return(excp->retval);
}
 
int matherr( struct exception * e)
{
    return(e->type);
}

⌨️ 快捷键说明

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