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

📄 scitech.h

📁 BIOS emulator and interface to Realmode X86 Emulator Library Can emulate a PCI Graphic Controller V
💻 H
📖 第 1 页 / 共 2 页
字号:
#if		defined(__M_ALPHA) || defined(__ALPHA_) || defined(__ALPHA) || defined(__alpha)#ifndef	__ALPHA__#define	__ALPHA__#endif#elif	defined(__M_PPC) || defined(__POWERC)#ifndef	__PPC__#define	__PPC__#endif#elif	defined(__M_MRX000)#ifndef	__MIPS__#define	__MIPS__#endif#else#ifndef	__INTEL__#define	__INTEL__				/* Assume Intel if nothing found */#endif#endif/* We have the following defines to define the calling conventions for * publicly accesible functions: * *  _PUBAPI  - Compiler default calling conventions for all public 'C' functions *  _ASMAPI  - Calling conventions for all public assembler functions *  _DLLAPI  - Calling conventions for all DLL exported functions *  _DLLVAR  - Modifier to export/import globals in 32 bit DLL's *  _EXPORT  - Expands to _export when compiling a DLL *  _VARAPI  - Modifiers for variables; Watcom C++ mangles C++ globals *	_STDCALL - Win32 __stdcall where possible, __cdecl if not supported */#if defined(_MSC_VER) && defined(_WIN32) && !defined(__SC__)#define __PASCAL    __stdcall#define __export#define	__import#else#define __PASCAL    __pascal#endif#if	defined(NO_STDCALL)#define	_STDCALL	__cdecl#else#define	_STDCALL	__stdcall#endif#ifdef	__WATCOMC__#if (__WATCOMC__ >= 1050)#define	_VARAPI		__cdecl#else#define	_VARAPI#endif#else#define	_VARAPI#endif#if	defined(__IBMC__) || defined(__IBMCPP__)#define PTR_DECL_IN_FRONT#endif#if     defined(__WINDOWS__)#ifdef  BUILD_DLL#define _DLLASM __export __cdecl#define _EXPORT __export#ifdef  __WINDOWS32__#define _DLLAPI __export __PASCAL#define _DLLVAR __export#else#define _DLLAPI  __export __far __pascal#define _DLLVAR#endif#else#define _DLLASM __cdecl#define	_EXPORT#ifdef  __WINDOWS32__#define _DLLAPI __PASCAL#define _DLLVAR __import#else#define _DLLAPI __far __pascal#define _DLLVAR#endif#endif#else#if !defined(__BEOS__)#define _EXPORT#endif#define _DLLAPI#define _DLLVAR#endif/* Define the calling conventions for all public functions. For simplicity * we define all public functions as __cdecl calling conventions, so that * they are the same across all compilers and runtime DLL's. */#define _PUBAPI __cdecl#define _ASMAPI __cdecl/* Determine the syntax for declaring a function pointer with a * calling conventions override. Most compilers require the calling * convention to be declared in front of the '*', but others require * it to be declared after the '*'. We handle both in here depending * on what the compiler requires. */#ifdef	PTR_DECL_IN_FRONT#define	_DLLAPIP	* _DLLAPI#define	_DLLASMP	* _DLLASM#define	_PUBAPIP	* _PUBAPI#define	_ASMAPIP	* _ASMAPI#else#define	_DLLAPIP	_DLLAPI *#define	_DLLASMP	_DLLASM *#define	_PUBAPIP	_PUBAPI *#define	_ASMAPIP	_ASMAPI *#endif/* Useful macros */#define PRIVATE static#define PUBLIC/* This HAS to be 0L for 16-bit real mode code to work!!! */#ifndef NULL#       define NULL 0L#endif#ifndef MAX#       define MAX(a,b) ( ((a) > (b)) ? (a) : (b))#endif#ifndef MIN#       define MIN(a,b) ( ((a) < (b)) ? (a) : (b))#endif#ifndef ABS#       define ABS(a)   ((a) >= 0 ? (a) : -(a))#endif#ifndef	SIGN#		define SIGN(a)	((a) > 0 ? 1 : -1)#endif/* General typedefs */#ifndef __GENDEFS#define __GENDEFS#if defined(__BEOS__)#include <SupportDefs.h>#else#ifdef __LINUX__#include <sys/types.h>#ifdef __STRICT_ANSI__typedef unsigned short  	ushort;typedef unsigned long   	ulong;typedef unsigned int    	uint;#endif#ifdef	__KERNEL__#define	__GENDEFS_2#endif#else#if !(defined(__QNXNTO__) && defined(GENERAL_STRUCT))typedef unsigned short  	ushort;typedef unsigned long   	ulong;#endiftypedef unsigned int    	uint;#endiftypedef unsigned char  		uchar;#endiftypedef int             	ibool;		/* Integer boolean type			*/#ifdef	USE_BOOL						/* Only for older code			*/#ifndef	__cplusplus#define	bool				ibool		/* Standard C					*/#else#ifndef	__HAS_BOOL__#define	bool				ibool		/* Older C++ compilers			*/#endif#endif	/* __cplusplus */#endif	/* USE_BOOL */#endif  /* __GENDEFS *//* More general typedefs compatible with Linux kernel code */#ifndef	__GENDEFS_2#define	__GENDEFS_2typedef char            	s8;typedef unsigned char   	u8;typedef short           	s16;typedef unsigned short  	u16;#ifdef	__16BIT__typedef long				s32;typedef unsigned long    	u32;#elsetypedef int             	s32;typedef unsigned int    	u32;#endif#ifdef	__HAS_LONG_LONG__typedef	long long			s64;typedef unsigned long long	u64;#elsetypedef struct {	s32	low;	s32	high;	} s64;typedef struct {	u32	low;	u32	high;	} u64;#endif#endif/* Boolean truth values */#undef	false#undef	true#undef	NO#undef	YES#undef	FALSE#undef	TRUE#define false       0#define true        1#define NO          0#define YES         1#define FALSE       0#define TRUE        1/* Inline debugger interrupts for Watcom C++ and Borland C++ */#ifdef	__WATCOMC__void DebugInt(void);#pragma aux DebugInt =				\	"int	3";void DebugVxD(void);#pragma aux DebugVxD =				\	"int	1";#elif	defined(__BORLANDC__)#define	DebugInt()	__emit__(0xCC)#define	DebugVxD()	{__emit__(0xCD); __emit__(0x01);}#elif	defined(_MSC_VER)#define	DebugInt()	_asm int 0x3#define	DebugVxD()	_asm int 0x1#elsevoid _ASMAPI DebugInt(void);void _ASMAPI DebugVxD(void);#endif/* Macros to break once and never break again */#define	DebugIntOnce()				\{                                   \	static ibool firstTime = true;  \	if (firstTime) {                \		firstTime = false;          \		DebugInt();                 \		}                           \}#define	DebugVxDOnce()				\{                                   \	static ibool firstTime = true;  \	if (firstTime) {                \		firstTime = false;          \		DebugVxD();                 \		}                           \}/*--------------------------------------------------------------------------- * Set of debugging macros used by the libraries. If the debug flag is * set, they are turned on depending on the setting of the flag. User code * can override the default functions called when a check fails, and the * MGL does this so it can restore the system from graphics mode to display * an error message. These functions also log information to the * scitech.log file in the root directory of the hard drive when problems * show up. * * If you set the value of CHECKED to be 2, it will also enable code to * insert hard coded debugger interrupt into the source code at the line of * code where the check fail. This is useful if you run the code under a * debugger as it will break inside the debugger before exiting with a * failure condition. * * Also for code compiled to run under Windows, we also call the * OutputDebugString function to send the message to the system debugger * such as Soft-ICE or WDEB386. Hence if you get any non-fatal warnings you * will see those on the debugger terminal as well as in the log file. *-------------------------------------------------------------------------*/#ifdef  __cplusplusextern "C" {            /* Use "C" linkage when in C++ mode */#endifextern void (*_CHK_fail)(int fatal,const char *msg,const char *cond,const char *file,int line);void _CHK_defaultFail(int fatal,const char *msg,const char *cond,const char *file,int line);#ifdef	CHECKED#       define  CHK(x)  	x#if		CHECKED > 1#		define	CHECK(p)											\		((p) ? (void)0 : DebugInt(),                                \			_CHK_fail(1,"Check failed: '%s', file %s, line %d\n",   \			#p, __FILE__, __LINE__))#		define	WARN(p)												\		((p) ? (void)0 : DebugInt(),                  				\			_CHK_fail(0,"Warning: '%s', file %s, line %d\n",   		\			#p, __FILE__, __LINE__))#else#		define	CHECK(p)											\		((p) ? (void)0 :                                 			\			_CHK_fail(1,"Check failed: '%s', file %s, line %d\n",   \			#p, __FILE__, __LINE__))#		define	WARN(p)												\		((p) ? (void)0 : 											\			_CHK_fail(0,"Warning: '%s', file %s, line %d\n",   		\			#p, __FILE__, __LINE__))#endif#		define	LOGFATAL(msg)										\			_CHK_fail(1,"Fatal error: '%s', file %s, line %d\n",   	\			msg, __FILE__, __LINE__)#		define	LOGWARN(msg)										\			_CHK_fail(0,"Warning: '%s', file %s, line %d\n",   		\			msg, __FILE__, __LINE__)#else#       define  CHK(x)#		define	CHECK(p)		((void)0)#		define	WARN(p)			((void)0)#		define	LOGFATAL(msg)	((void)0)#		define	LOGWARN(msg)	((void)0)#endif#ifdef	__cplusplus}						/* End of "C" linkage for C++	*/#endif#endif  /* __SCITECH_H */

⌨️ 快捷键说明

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