wccomp.c

来自「这是一个符合posix.13 pse51的实时内核」· C语言 代码 · 共 44 行

C
44
字号
/* 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: WCComp.C			   		  */
/* Watcom-C Quirks for 16 bit console library		  */

/*
    To avoid different library structure among the 16 bit & 32 bit
    HARTIK system, I redefine the C startup sequence in 16 bit,
    calling bios_save() before all!
    This is useful to load proper values into the console subsystem!!    
*/

#include <stdlib.h>
#include <hw_dep.h>

#pragma aux     _CMain  "_*";

extern	int	___Argc;	  /* argument count */
extern	char **	___Argv;	  /* argument vector */
extern unsigned __near _amblksiz; /*  mallocs done in multiples of    */

extern void bios_save(void);
extern void bios_restore(void);
extern void bios_exit(unsigned r);

extern	int main( int, char ** );
void _CMain()
{
    extern int atexit(register void (*__func)(void));
    extern void X_callBIOS_init(void);
    unsigned r;
    _amblksiz = 8 * 1024;   /* set minimum memory block allocation */
    bios_save();
    X_callBIOS_init();
    atexit(bios_restore);
    r = main( ___Argc, ___Argv );
    exit(r);
}

⌨️ 快捷键说明

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