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
00030
00031 #ifndef MORE_STDINT_H
00032 #define MORE_STDINT_H
00033
00034 #include <more/bits/config.h>
00035
00036 #ifdef HAVE_STDINT_H
00037 #include <stdint.h>
00038
00039 namespace more {
00040 namespace lang {
00041
00042 using ::uint8_t;
00043 using ::int8_t;
00044 using ::uint16_t;
00045 using ::int16_t;
00046 using ::uint32_t;
00047 using ::int32_t;
00048 using ::uint64_t;
00049 using ::int64_t;
00050
00051 using ::uint_least8_t;
00052 using ::int_least8_t;
00053 using ::uint_least16_t;
00054 using ::int_least16_t;
00055 using ::uint_least32_t;
00056 using ::int_least32_t;
00057 using ::uint_least64_t;
00058 using ::int_least64_t;
00059
00060 using ::uint_fast8_t;
00061 using ::int_fast8_t;
00062 using ::uint_fast16_t;
00063 using ::int_fast16_t;
00064 using ::uint_fast32_t;
00065 using ::int_fast32_t;
00066 using ::uint_fast64_t;
00067 using ::int_fast64_t;
00068
00069 using ::intmax_t;
00070 using ::uintmax_t;
00071
00072 using ::intptr_t;
00073 using ::uintptr_t;
00074
00075 }}
00076
00077 #else
00078
00079 namespace more {
00080 namespace lang {
00081
00082
00083 #if SIZEOF_CHAR < 1
00084 # error "Oops, SIZEOF_CHAR < 1! Problems with the configuration?"
00085 #endif
00086
00087
00088 typedef unsigned char uint_least8_t;
00089
00090 typedef signed char int_least8_t;
00091
00092 #if SIZEOF_SHORT >= 2
00093 typedef unsigned short uint_least16_t;
00094 typedef short int_least16_t;
00095 #else
00096 # error "Short should be at least 16 bits wide, check configuration."
00097 #endif
00098
00099 #if SIZEOF_SHORT >= 4
00100 typedef unsigned short uint_least32_t;
00101 typedef short int_least32_t;
00102 #elif SIZEOF_INT >= 4
00103 typedef unsigned int uint_least32_t;
00104 typedef int int_least32_t;
00105 #elif SIZEOF_LONG >= 4
00106 typedef unsigned long uint_least32_t;
00107 typedef long int_least32_t;
00108 #else
00109 # error "Could not find a >=32 bit wide integer, check configuration."
00110 #endif
00111
00112 #if SIZEOF_INT >= 8
00113 # define MORE_HAVE_INT_LEAST64_T
00114 typedef unsigned int uint_least64_t;
00115 typedef int int_least64_t;
00116 #elif SIZEOF_LONG >= 8
00117 # define MORE_HAVE_INT_LEAST64_T
00118 typedef unsigned long uint_least64_t;
00119 typedef long int_least64_t;
00120 #elif SIZEOF_LONG_LONG >= 8
00121 # define MORE_HAVE_INT_LEAST64_T
00122 typedef unsigned long long uint_least64_t;
00123 typedef long long int_least64_t;
00124 #endif
00125
00126
00127
00128
00129 typedef uint_least8_t uint_fast8_t;
00130 typedef int_least8_t int_fast8_t;
00131 typedef uint_least8_t uint8_t;
00132 typedef int_least8_t int8_t;
00133
00134 typedef uint_least16_t uint_fast16_t;
00135 typedef int_least16_t int_fast16_t;
00136 typedef uint_least16_t uint16_t;
00137 typedef int_least16_t int16_t;
00138
00139 typedef uint_least32_t uint_fast32_t;
00140 typedef int_least32_t int_fast32_t;
00141 typedef uint_least32_t uint32_t;
00142 typedef int_least32_t int32_t;
00143
00144 #ifdef MORE_HAVE_INT_LEAST64_T
00145 typedef uint_least64_t uint_fast64_t;
00146 typedef int_least64_t int_fast64_t;
00147 typedef uint_least64_t uint64_t;
00148 typedef int_least64_t int64_t;
00149 #endif
00150
00151 #ifdef CXX_HAVE_LONG_LONG
00152
00153 typedef long long intmax_t;
00154 typedef unsigned long long uintmax_t;
00155 #else
00156
00157 typedef long intmax_t;
00158 typedef unsigned long uintmax_t;
00159 #endif
00160
00161 #if SIZEOF_VOIDP <= SIZEOF_INT
00162 typedef unsigned int uintptr_t;
00163 typedef int intptr_t;
00164 #elif SIZEOF_VOIDP <= SIZEOF_LONG
00165 typedef unsigned long uintptr_t;
00166 typedef long intptr_t;
00167 #elif SIZEOF_VOIDP <= SIZEOF_LONG_LONG
00168 typedef unsigned long long uintptr_t;
00169 typedef long long intptr_t;
00170 #else
00171 # error "No integer has the width of a pointer, check configuration."
00172 #endif
00173
00174 }}
00175
00176 #endif // HAVE_STDINT_H
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200 #endif