发表于:2007-05-08 23:09:00
楼主
#ifndef SPC3_H__ /* include only once */
#define SPC3_H__
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifndef SPC3_INTEL_MODE
#error !!! FEHLER !!! SPC3_INTEL_MODE wurde nicht deklariert !!!
#endif /* Ende fuer SPC3_INTEL_MODE */
/*+-------------------------------------------------------------------------+
| C o m p i l e r - d e p e n d e n d D e f i n i t i o n s |
+-------------------------------------------------------------------------+*/
/*------------------------ BSO Tasking C166-Compiler ------------------------*/
#ifdef _C166
#define _INTEL_COMP /* iNTEL-mode */
#define SPC3_DATA_ATTR
#ifndef SPC3_NO_BASE_TYPES
#ifndef SPC3_BASE_TYPES_DEF__
typedef unsigned char UBYTE;
typedef unsigned int UWORD;
typedef char BYTE;
typedef int WORD;
#define SPC3_BASE_TYPES_DEF__
#endif /* end SPC3_BASE_TYPES_DEF__ */
#endif /* end SPC3_NO_BASE_TYPES */
#ifdef SPC3_FAR
#define SPC3_PTR_ATTR far
typedef unsigned long SPC3_ADTYP;
#else
#ifdef SPC3_NEAR
#define SPC3_PTR_ATTR near
typedef unsigned int SPC3_ADTYP;
typedef unsigned short SPC3_OFFS;
#else
#error !!! ERROR !!! neither SPC3_FAR nor SPC3_NEAR defined !!!
#endif /* end SPC3_NEAR */
#endif /* end SPC3_FAR */
/*--------------------- end BSO Tasking C166-Compiler ----------------------*/
/*--------------------------- Keil 80C32-Compiler ---------------------------*/
#elif defined __C51__ /* Motorola-mode */
#ifndef SPC3_NO_BASE_TYPES
#ifndef SPC3_BASE_TYPES_DEF__
typedef unsigned char UBYTE;
typedef unsigned int UWORD;
typedef char BYTE;
typedef int WORD;
#define SPC3_BASE_TYPES_DEF__
#endif /* end SPC3_BASE_TYPES_DEF__ */
#endif /* end SPC3_NO_BASE_TYPES */
#define SPC3_PTR_ATTR xdata
#ifdef SPC3_DATA_XDATA
#define SPC3_DATA_ATTR xdata
#else
#ifdef SPC3_DATA_IDATA
#define SPC3_DATA_ATTR idata
#else
#define SPC3_DATA_ATTR
#endif
#endif
typedef unsigned int SPC3_ADTYP;
typedef unsigned short SPC3_OFFS;
typedef unsigned int SPC3_PTR;
/*------------------------ end Keil 80C32-Compiler -------------------------*/
#else /* no supported compiler found */
#error !!! ERROR !!! Unknown compiler&