/* 最小类型:指定长度的最小类型 */
/* 有符号 */
typedef signed char int_least8_t;
typedef short int int_least16_t;
typedef int int_least32_t;
#if __WORDSIZE == 64
typedef long int int_least64_t;
#else
__extension__
typedef long long int int_least64_t;
#endif
/* 无符号 */
typedef unsigned char uint_least8_t;
typedef unsigned short int uint_least16_t;
typedef unsigned int uint_least32_t;
#if __WORDSIZE == 64
typedef unsigned long int uint_least64_t;
#else
__extension__
typedef unsigned long long int uint_least64_t;
#endif
/* 快速类型:指定长度的最快类型 */
/* 有符号 */
typedef signed char int_fast8_t;
#if __WORDSIZE == 64 /* 64位平台 */
typedef long int int_fast16_t;
typedef long int int_fast32_t;
typedef long int int_fast64_t;
#else /* 32位平台 */
typedef int int_fast16_t; /* 16位和32位的最快类型均为int */
typedef int int_fast32_t;
__extension__
typedef long long int int_fast64_t;
#endif
/* 无符号 */
typedef unsigned char uint_fast8_t;
#if __WORDSIZE == 64
typedef unsigned long int uint_fast16_t;
typedef unsigned long int uint_fast32_t;
typedef unsigned long int uint_fast64_t;
#else
typedef unsigned int uint_fast16_t;
typedef unsigned int uint_fast32_t;
__extension__
typedef unsigned long long int uint_fast64_t;
#endif
/* 通用指针类型:即void * 型指针的类型,64位平台上为long,32位平台上为int */
#if __WORDSIZE == 64
# ifndef __intptr_t_defined
typedef long int intptr_t;
# define __intptr_t_defined
# endif
typedef unsigned long int uintptr_t;
#else
# ifndef __intptr_t_defined
typedef int intptr_t;
# define __intptr_t_defined
# endif
typedef unsigned int uintptr_t;
#endif
/* 最大类型:指定长度的最大整数类型 */
#if __WORDSIZE == 64
typedef long int intmax_t; /* 64位平台上的最大整数类型为long */
typedef unsigned long int uintmax_t;
#else
__extension__
typedef long long int intmax_t; /* 32位平台上的最大整数类型为long long */
__extension__
typedef unsigned long long int uintmax_t;
#endif
/* ISO C99标准指出,在C++实现中这些宏应该只在被请求到的时候才定义 */
#if !defined __cplusplus || defined __STDC_LIMIT_MACROS
# if __WORDSIZE == 64
# define __INT64_C(c) c ## L
# define __UINT64_C(c) c ## UL
# else
# define __INT64_C(c) c ## LL
# define __UINT64_C(c) c ## ULL
# endif
/* 整数类型的范围 */
/* 有符号整数类型的最小值:-2**(N-1),其中最小负数-2**(N-1)=100...0没有对应正数,其反数还是自己 */
# define INT8_MIN (-128)
# define INT16_MIN (-32767-1)
# define INT32_MIN (-2147483647-1)
# define INT64_MIN (-__INT64_C(9223372036854775807)-1)
/* 有符号整数类型的最大值:2**(N-1)-1 */
# define INT8_MAX (127)
# define INT16_MAX (32767)
# define INT32_MAX (2147483647)
# define INT64_MAX (__INT64_C(9223372036854775807))
/* 无符号整数类型的最大值:2**(N-1)-1,注意有Min=-MAX-1 */
# define UINT8_MAX (255)
# define UINT16_MAX (65535)
# define UINT32_MAX (4294967295U)
# define UINT64_MAX (__UINT64_C(18446744073709551615))
/* 有符号最小类型的最小值 */
# define INT_LEAST8_MIN (-128)
# define INT_LEAST16_MIN (-32767-1)
# define INT_LEAST32_MIN (-2147483647-1)
# define INT_LEAST64_MIN (-__INT64_C(9223372036854775807)-1)
/* 有符号最小类型的最大值 */
# define INT_LEAST8_MAX (127)
# define INT_LEAST16_MAX (32767)
# define INT_LEAST32_MAX (2147483647)
# define INT_LEAST64_MAX (__INT64_C(9223372036854775807))
/* 无符号最小类型的最大值 */
# define UINT_LEAST8_MAX (255)
# define UINT_LEAST16_MAX (65535)
# define UINT_LEAST32_MAX (4294967295U)
# define UINT_LEAST64_MAX (__UINT64_C(18446744073709551615))