base_types.h
来源:互联网 发布:婚恋交友网站源码 编辑:程序博客网 时间:2024/06/05 06:49
#ifndef BASE_BASE_TYPES_H
#define BASE_BASE_TYPES_H
#include <sys/types.h>
#include "base/base_api.h"
#ifndef COMPILER_MSVC
// stdint.h is part of C99 but MSVC doesn't have it.
#include <stdint.h> // For intptr_t.
#endif
/* Even in pure C, we still need a standard boolean typedef */
#ifndef __cplusplus
typedef unsigned char bool;
#define true 1
#define false 0
#endif // __cplusplus
#ifndef NULL
#define NULL 0
#endif
/* define int types*/
#if defined(COMPILER_GCC)
#ifndef _STDINT_H
/* FreeBSD has these C99 int types defined in /sys/inttypes.h already */
#ifndef _SYS_TYPES_H
typedef signed char int8_t;
typedef signed short int16_t;
typedef signed int int32_t;
typedef signed long long int64_t;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long long uint64_t;
#else
typedef u_int8_t uint8_t;
typedef u_int16_t uint16_t;
typedef u_int32_t uint32_t;
typedef u_int64_t uint64_t;
#endif // _SYS_TYPES_H
#endif // _STDINT_H
#elif defined(COMPILER_MSVC)
typedef signed char int8_t;
typedef signed short int16_t;
typedef signed int int32_t;
typedef signed __int64 int64_t;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned __int64 uint64_t;
/* the following definitions are from VS2010's stdint.h */
#ifndef _INTPTR_T_DEFINED
#define _INTPTR_T_DEFINED
#ifdef _WIN64
typedef __int64 intptr_t;
#else /* _WIN64 */
typedef _W64 int intptr_t;
#endif /* _WIN64 */
#endif /* _INTPTR_T_DEFINED */
#ifndef _UINTPTR_T_DEFINED
#define _UINTPTR_T_DEFINED
#ifdef _WIN64
typedef unsigned __int64 uintptr_t;
#else /* _WIN64 */
typedef _W64 unsigned int uintptr_t;
#endif /* _WIN64 */
#endif /* _UINTPTR_T_DEFINED */
#endif // COMPILER_GCC/COMPILER_MSVC
const uint8_t kUint8Max = (( uint8_t) 0xFF);
const uint16_t kUint16Max = ((uint16_t) 0xFFFF);
const uint32_t kUint32Max = ((uint32_t) 0xFFFFFFFF);
const uint64_t kUint64Max = ((uint64_t) GG_LONGLONG(0xFFFFFFFFFFFFFFFF));
const int8_t kInt8Min = (( int8_t) 0x80);
const int8_t kInt8Max = (( int8_t) 0x7F);
const int16_t kInt16Min = (( int16_t) 0x8000);
const int16_t kInt16Max = (( int16_t) 0x7FFF);
const int32_t kInt32Min = (( int32_t) 0x80000000);
const int32_t kInt32Max = (( int32_t) 0x7FFFFFFF);
const int64_t kInt64Min = (( int64_t) GG_LONGLONG(0x8000000000000000));
const int64_t kInt64Max = (( int64_t) GG_LONGLONG(0x7FFFFFFFFFFFFFFF));
#endif // BASE_BASE_TYPES_H
#define BASE_BASE_TYPES_H
#include <sys/types.h>
#include "base/base_api.h"
#ifndef COMPILER_MSVC
// stdint.h is part of C99 but MSVC doesn't have it.
#include <stdint.h> // For intptr_t.
#endif
/* Even in pure C, we still need a standard boolean typedef */
#ifndef __cplusplus
typedef unsigned char bool;
#define true 1
#define false 0
#endif // __cplusplus
#ifndef NULL
#define NULL 0
#endif
/* define int types*/
#if defined(COMPILER_GCC)
#ifndef _STDINT_H
/* FreeBSD has these C99 int types defined in /sys/inttypes.h already */
#ifndef _SYS_TYPES_H
typedef signed char int8_t;
typedef signed short int16_t;
typedef signed int int32_t;
typedef signed long long int64_t;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long long uint64_t;
#else
typedef u_int8_t uint8_t;
typedef u_int16_t uint16_t;
typedef u_int32_t uint32_t;
typedef u_int64_t uint64_t;
#endif // _SYS_TYPES_H
#endif // _STDINT_H
#elif defined(COMPILER_MSVC)
typedef signed char int8_t;
typedef signed short int16_t;
typedef signed int int32_t;
typedef signed __int64 int64_t;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned __int64 uint64_t;
/* the following definitions are from VS2010's stdint.h */
#ifndef _INTPTR_T_DEFINED
#define _INTPTR_T_DEFINED
#ifdef _WIN64
typedef __int64 intptr_t;
#else /* _WIN64 */
typedef _W64 int intptr_t;
#endif /* _WIN64 */
#endif /* _INTPTR_T_DEFINED */
#ifndef _UINTPTR_T_DEFINED
#define _UINTPTR_T_DEFINED
#ifdef _WIN64
typedef unsigned __int64 uintptr_t;
#else /* _WIN64 */
typedef _W64 unsigned int uintptr_t;
#endif /* _WIN64 */
#endif /* _UINTPTR_T_DEFINED */
#endif // COMPILER_GCC/COMPILER_MSVC
const uint8_t kUint8Max = (( uint8_t) 0xFF);
const uint16_t kUint16Max = ((uint16_t) 0xFFFF);
const uint32_t kUint32Max = ((uint32_t) 0xFFFFFFFF);
const uint64_t kUint64Max = ((uint64_t) GG_LONGLONG(0xFFFFFFFFFFFFFFFF));
const int8_t kInt8Min = (( int8_t) 0x80);
const int8_t kInt8Max = (( int8_t) 0x7F);
const int16_t kInt16Min = (( int16_t) 0x8000);
const int16_t kInt16Max = (( int16_t) 0x7FFF);
const int32_t kInt32Min = (( int32_t) 0x80000000);
const int32_t kInt32Max = (( int32_t) 0x7FFFFFFF);
const int64_t kInt64Min = (( int64_t) GG_LONGLONG(0x8000000000000000));
const int64_t kInt64Max = (( int64_t) GG_LONGLONG(0x7FFFFFFFFFFFFFFF));
#endif // BASE_BASE_TYPES_H
- base_types.h
- h
- h
- h
- ,h
- h
- h
- H
- h
- h
- h
- H
- h
- H
- H
- h
- H
- H
- iOS:NSCoder的方法encodeSize:forKey:
- SQL SERVER损坏文件的修复工具
- 导入flex项目提示未安装ASP.NET Development Server
- 算法:ACM算法学习
- 计算机组成原理试题3
- base_types.h
- 计算机组成原理试题4
- 类加载顺序
- iOS:NSCoder的方法encodeValueOfObjCType:at:
- MOS管开关电路设计知识
- 如何辨别耳机插头与插座的左右声道
- 如何在PADS中添加表面型测试点
- shell中出现的特殊符号
- 浅谈:产品发展战略应该与行业发展的不同阶段相吻合!顺势而为才能事半功倍