types.h

来自「ISCSI target.It can be used to make up a」· C头文件 代码 · 共 36 行

H
36
字号
/* * Copyright (C) 2002-2003 Ardis Technolgies <roman@ardistech.com> * * Released under the terms of the GNU GPL v2.0. */#ifndef TYPES_H#define TYPES_H#include <sys/types.h>#include <byteswap.h>#include <endian.h>#include <stdint.h>#include <inttypes.h>#if __BYTE_ORDER == __BIG_ENDIAN#define cpu_to_be16(x)		(x)#define be16_to_cpu(x)		(x)#define cpu_to_be32(x)		(x)#define be32_to_cpu(x)		(x)#elif __BYTE_ORDER == __LITTLE_ENDIAN#define cpu_to_be16(x)		bswap_16(x)#define be16_to_cpu(x)		bswap_16(x)#define cpu_to_be32(x)		bswap_32(x)#define be32_to_cpu(x)		bswap_32(x)#else#error "unknown endianess!"#endiftypedef u_int8_t u8;typedef u_int16_t u16;typedef u_int32_t u32;typedef u_int64_t u64;#endif	/* TYPES_H */

⌨️ 快捷键说明

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