00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef _BITTYPES_H
00030 #define _BITTYPES_H
00031
00032 #ifndef HAVE_U_INT8_T
00033
00034 #if SIZEOF_CHAR == 1
00035 typedef unsigned char u_int8_t;
00036 typedef signed char int8_t;
00037 #elif SIZEOF_INT == 1
00038 typedef unsigned int u_int8_t;
00039 typedef signed int int8_t;
00040 #else
00041 #error "there's no appropriate type for u_int8_t"
00042 #endif
00043 #define HAVE_U_INT8_T 1
00044 #define HAVE_INT8_T 1
00045
00046 #endif
00047
00048 #ifndef HAVE_U_INT16_T
00049
00050 #if SIZEOF_SHORT == 2
00051 typedef unsigned short u_int16_t;
00052 typedef signed short int16_t;
00053 #elif SIZEOF_INT == 2
00054 typedef unsigned int u_int16_t;
00055 typedef signed int int16_t;
00056 #elif SIZEOF_CHAR == 2
00057 typedef unsigned char u_int16_t;
00058 typedef signed char int16_t;
00059 #else
00060 #error "there's no appropriate type for u_int16_t"
00061 #endif
00062 #define HAVE_U_INT16_T 1
00063 #define HAVE_INT16_T 1
00064
00065 #endif
00066
00067 #ifndef HAVE_U_INT32_T
00068
00069 #if SIZEOF_INT == 4
00070 typedef unsigned int u_int32_t;
00071 typedef signed int int32_t;
00072 #elif SIZEOF_LONG == 4
00073 typedef unsigned long u_int32_t;
00074 typedef signed long int32_t;
00075 #elif SIZEOF_SHORT == 4
00076 typedef unsigned short u_int32_t;
00077 typedef signed short int32_t;
00078 #else
00079 #error "there's no appropriate type for u_int32_t"
00080 #endif
00081 #define HAVE_U_INT32_T 1
00082 #define HAVE_INT32_T 1
00083
00084 #endif
00085
00086 #ifndef HAVE_U_INT64_T
00087 #if SIZEOF_LONG_LONG == 8
00088 typedef unsigned long long u_int64_t;
00089 #elif defined(_MSC_EXTENSIONS)
00090 typedef unsigned _int64 u_int64_t;
00091 #elif SIZEOF_INT == 8
00092 typedef unsigned int u_int64_t;
00093 #elif SIZEOF_LONG == 8
00094 typedef unsigned long u_int64_t;
00095 #elif SIZEOF_SHORT == 8
00096 typedef unsigned short u_int64_t;
00097 #else
00098 #error "there's no appropriate type for u_int64_t"
00099 #endif
00100
00101 #endif
00102
00103 #ifndef PRId64
00104 #ifdef _MSC_EXTENSIONS
00105 #define PRId64 "I64d"
00106 #else
00107 #define PRId64 "lld"
00108 #endif
00109 #endif
00110
00111 #ifndef PRIo64
00112 #ifdef _MSC_EXTENSIONS
00113 #define PRIo64 "I64o"
00114 #else
00115 #define PRIo64 "llo"
00116 #endif
00117 #endif
00118
00119 #ifndef PRIx64
00120 #ifdef _MSC_EXTENSIONS
00121 #define PRIx64 "I64x"
00122 #else
00123 #define PRIx64 "llx"
00124 #endif
00125 #endif
00126
00127 #ifndef PRIu64
00128 #ifdef _MSC_EXTENSIONS
00129 #define PRIu64 "I64u"
00130 #else
00131 #define PRIu64 "llu"
00132 #endif
00133 #endif
00134
00135 #endif