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

📄 vcitypes.h

📁 这是DVD中伺服部分的核心代码
💻 H
📖 第 1 页 / 共 3 页
字号:
typedef double DOUBLE;                            /* 64 bits - double precision */
typedef unsigned long ERR_CODE;                   /* 32 bits - unsigned integer */
typedef unsigned char BOOLEAN;                    /* 8  bits - boolean */

/* Boolean values -- I think these are predefined, but it's best to be sure */
#ifndef TRUE                                      /* TRUE = 1 */
#define TRUE (1)
#endif

#ifndef FALSE                                     /* FALSE = 0 */
#define FALSE (0)
#endif

/*****************/
/* Pointer Types */
/*****************/
typedef void *PVOID;                              /* 32 bits - void pointer */
typedef CHAR *STR;                                /* 8*(strlen+1) bits (Null Terminated)*/

#endif /* __TCS__ */


/* ---------------------------------------------------------------------------
 * Compiler / Platform:
 * Keil C51 (8051)
 *
 * Author:
 * Cory T. Tusar
 *
 * Maintainer:
 * Cory T. Tusar
 *
 * Notes:
 * This compiler does not support 64-bit data types.  It's happiest with
 * 8-bit unsigned stuff.
 */
#if defined(__C51__)

#if 0  /* This is ANSI C (stdarg.h), and should not be redefined here. */
#if defined(NULL)
#warning "Redefining NULL in vcitypes.h"
#undef NULL
#endif  /* NULL */
#define NULL                            ((void *)0)
#endif

#if defined(TRUE)
#warning "Redefining TRUE in vcitypes.h"
#undef TRUE
#endif  /* TRUE */
#define TRUE                            (1 == 1)


#if defined(FALSE)
#warning "Redefining FALSE in vcitypes.h"
#undef FALSE
#endif  /* FALSE */
#define FALSE                           (1 == 0)


#undef DBG_PRINT
#if defined(DEBUG)
#define DBG_PRINT(x)                    { uartPrintf x; }
#else
#define DBG_PRINT(x)                    /##/ x
#endif  /* DEBUG */


/**
 * @def MIN(x, y)
 * Evaluates to the minimum of x and y.
 */
/**
 * @def MAX(x, y)
 * Evaluates to the maximum of x and y.
 */
#define MIN(x, y)                       (((x) < (y)) ? (x) : (y))
#define MAX(x, y)                       (((x) > (y)) ? (x) : (y))

#define NIBBLESWAP(x)                   ((x << 4) | (x >> 4))
#define BYTESWAP(x)                     ((x << 8) | (x >> 8))
#define WORDSWAP(x)                     ((x << 16) | (x >> 16))

#define uint16_high_byte_get(x)         ((uint8)(x >> 8))
#define uint16_low_byte_get(x)          ((uint8)x)

typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned long uint32;
typedef signed char int8;
typedef signed short int16;
typedef signed long int32;

typedef signed char CHAR;
typedef signed short WCHAR;
typedef signed short SHORT;
typedef signed long LONG;

typedef unsigned char BYTE;
typedef unsigned char UCHAR;
typedef unsigned short USHORT;
typedef unsigned long ULONG;

typedef float FLOAT;
typedef double DOUBLE;
typedef unsigned long ERR_CODE;
typedef bit BOOLEAN;

typedef void *PVOID;
typedef char *STR;

#endif  /* __C51__ */


/* ---------------------------------------------------------------------------
 * Compiler / Platform:
 * SDCC MCS51 (8051)
 *
 * Author:
 * Cory T. Tusar
 *
 * Maintainer:
 * Cory T. Tusar
 *
 * Notes:
 * This compiler does not support 64-bit data types.  It's happiest with
 * 8-bit unsigned stuff.
 */
#if (defined(SDCC) && defined(SDCC_mcs51))

#if 0  /* This is ANSI C (stdarg.h), and should not be redefined here. */
#if defined(NULL)
#warning "Redefining NULL in vcitypes.h"
#undef NULL
#endif  /* NULL */
#define NULL                            ((void *)0)
#endif

#if defined(TRUE)
#warning "Redefining TRUE in vcitypes.h"
#undef TRUE
#endif  /* TRUE */
#define TRUE                            (1 == 1)

#if defined(FALSE)
#warning "Redefining FALSE in vcitypes.h"
#undef FALSE
#endif  /* FALSE */
#define FALSE                           (1 == 0)


//#define DBG_PRINT(x) {printf(x)}
//printf("%s: %d: ", __FILE__, __LINE__); printf x; printf("\n");


/**
 * @def MIN(x, y)
 * Evaluates to the minimum of x and y.
 */
/**
 * @def MAX(x, y)
 * Evaluates to the maximum of x and y.
 */
#define MIN(x, y)                       (((x) < (y)) ? (x) : (y))
#define MAX(x, y)                       (((x) > (y)) ? (x) : (y))

#define NIBBLESWAP(x)                   ((x << 4) | (x >> 4))
#define BYTESWAP(x)                     ((x << 8) | (x >> 8))
#define WORDSWAP(x)                     ((x << 16) | (x >> 16))


typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned long uint32;
typedef signed char int8;
typedef signed short int16;
typedef signed long int32;

typedef signed char CHAR;
typedef signed short WCHAR;
typedef signed short SHORT;
typedef signed long LONG;

typedef unsigned char BYTE;
typedef unsigned char UCHAR;
typedef unsigned short USHORT;
typedef unsigned long ULONG;

typedef float FLOAT;
typedef unsigned long ERR_CODE;
typedef unsigned char BOOLEAN;

typedef void *PVOID;
typedef char *STR;

#endif  /* SDCC && SDCC_mcs51 */


/*****************************************************************************
******************************************************************************
**                                                                          **
**  Compiler / Platform:                                                    **
**    vxWorks / GNUsparc                                                    **
**                                                                          **
**  Author:                                                                 **
**    Terry Corl                                                            **
**                                                                          **
**  Maintainer:                                                             **
**    Terry Corl                                                            **
**                                                                          **
**  Notes:                                                                  **
**    1)  vxWorks.h must precede this file in being #included!              **
**    2)  This compiler does not support 64-bit data types.                 **
**                                                                          **
**  Revision History:                                                       **
**    08/22/00  TC    File origination                                      **
**    09/20/00  CTT   Fixed backwards typedefs                              **
**                                                                          **
******************************************************************************
*****************************************************************************/
#ifdef __INCvxWorksh

/* defines for vxWorks tornado environment */
typedef char                  CHAR;               /* 8 bit */
typedef unsigned char         BYTE;               /* 8 bit */
typedef unsigned char         UCHAR;              /* 8 bit */
typedef unsigned char         BOOLEAN;            /* 8 bit */
typedef unsigned short        USHORT;             /* 16 bit */
typedef short                 WCHAR;              /* 16 bit */
typedef short                 SHORT;              /* 16 bit */
typedef int                   LONG ;              /* 32 bit */
typedef unsigned int          ULONG;              /* 32 bit */
typedef void *                PVOID;              /* 32 bit */
typedef unsigned int          ERR_CODE;           /* 32 bit */
typedef float                 FLOAT;
typedef double                DOUBLE;

/*  64 bit not defined for this compiler
typedef unsigned long long    ULONGLONG;
typedef long long             LONGLONG;
*/

#endif  /* __INCvxWorksh */


#if defined(__linux__) || defined(__LINUX__)
/*****************************************************************************
******************************************************************************
**                                                                          **
**  Compiler / Platform:                                                    **
**    uClinux                                                               **
**                                                                          **
**  Author:                                                                 **
**    Arthur Shipkowski                                                     **
**                                                                          **
**  Maintainer:                                                             **
**    Arthur Shipkowski                                                     **
**                                                                          **
**  Notes:                                                                  **
**    64-bit values only available on some platforms.                       **
**                                                                          **
**  Revision History:                                                       **
**    03/14/02  AES   File origination                                      **
**                                                                          **
******************************************************************************
*****************************************************************************/

#if 0  /* This is ANSI C (stdarg.h), and should not be redefined here. */
#if defined(NULL)
#warning "Redefining NULL in vcitypes.h"
#undef NULL
#endif  /* NULL */
#define NULL                            ((void *)0)
#endif

#if defined(TRUE)
#warning "Redefining TRUE in vcitypes.h"
#undef TRUE
#endif  /* TRUE */
#define TRUE                            (1 == 1)

⌨️ 快捷键说明

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