Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygeninttypes.h
Go to the documentation of this file.
00001 00006 /* 7.8 Format conversion of integer types <inttypes.h> */ 00007 00008 #ifndef _INTTYPES_H_ 00009 #define _INTTYPES_H_ 00010 00011 #include <crtdefs.h> 00012 #include <stdint.h> 00013 #define __need_wchar_t 00014 #include <stddef.h> 00015 00016 #ifdef __cplusplus 00017 extern "C" { 00018 #endif 00019 00020 typedef struct { 00021 intmax_t quot; 00022 intmax_t rem; 00023 } imaxdiv_t; 00024 00025 #if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) 00026 00027 /* 7.8.1 Macros for format specifiers 00028 * 00029 * MS runtime does not yet understand C9x standard "ll" 00030 * length specifier. It appears to treat "ll" as "l". 00031 * The non-standard I64 length specifier causes warning in GCC, 00032 * but understood by MS runtime functions. 00033 */ 00034 00035 /* fprintf macros for signed types */ 00036 #define PRId8 "d" 00037 #define PRId16 "d" 00038 #define PRId32 "d" 00039 #define PRId64 "I64d" 00040 00041 #define PRIdLEAST8 "d" 00042 #define PRIdLEAST16 "d" 00043 #define PRIdLEAST32 "d" 00044 #define PRIdLEAST64 "I64d" 00045 00046 #define PRIdFAST8 "d" 00047 #define PRIdFAST16 "d" 00048 #define PRIdFAST32 "d" 00049 #define PRIdFAST64 "I64d" 00050 00051 #define PRIdMAX "I64d" 00052 00053 #define PRIi8 "i" 00054 #define PRIi16 "i" 00055 #define PRIi32 "i" 00056 #define PRIi64 "I64i" 00057 00058 #define PRIiLEAST8 "i" 00059 #define PRIiLEAST16 "i" 00060 #define PRIiLEAST32 "i" 00061 #define PRIiLEAST64 "I64i" 00062 00063 #define PRIiFAST8 "i" 00064 #define PRIiFAST16 "i" 00065 #define PRIiFAST32 "i" 00066 #define PRIiFAST64 "I64i" 00067 00068 #define PRIiMAX "I64i" 00069 00070 #define PRIo8 "o" 00071 #define PRIo16 "o" 00072 #define PRIo32 "o" 00073 #define PRIo64 "I64o" 00074 00075 #define PRIoLEAST8 "o" 00076 #define PRIoLEAST16 "o" 00077 #define PRIoLEAST32 "o" 00078 #define PRIoLEAST64 "I64o" 00079 00080 #define PRIoFAST8 "o" 00081 #define PRIoFAST16 "o" 00082 #define PRIoFAST32 "o" 00083 #define PRIoFAST64 "I64o" 00084 00085 #define PRIoMAX "I64o" 00086 00087 /* fprintf macros for unsigned types */ 00088 #define PRIu8 "u" 00089 #define PRIu16 "u" 00090 #define PRIu32 "u" 00091 #define PRIu64 "I64u" 00092 00093 00094 #define PRIuLEAST8 "u" 00095 #define PRIuLEAST16 "u" 00096 #define PRIuLEAST32 "u" 00097 #define PRIuLEAST64 "I64u" 00098 00099 #define PRIuFAST8 "u" 00100 #define PRIuFAST16 "u" 00101 #define PRIuFAST32 "u" 00102 #define PRIuFAST64 "I64u" 00103 00104 #define PRIuMAX "I64u" 00105 00106 #define PRIx8 "x" 00107 #define PRIx16 "x" 00108 #define PRIx32 "x" 00109 #define PRIx64 "I64x" 00110 00111 #define PRIxLEAST8 "x" 00112 #define PRIxLEAST16 "x" 00113 #define PRIxLEAST32 "x" 00114 #define PRIxLEAST64 "I64x" 00115 00116 #define PRIxFAST8 "x" 00117 #define PRIxFAST16 "x" 00118 #define PRIxFAST32 "x" 00119 #define PRIxFAST64 "I64x" 00120 00121 #define PRIxMAX "I64x" 00122 00123 #define PRIX8 "X" 00124 #define PRIX16 "X" 00125 #define PRIX32 "X" 00126 #define PRIX64 "I64X" 00127 00128 #define PRIXLEAST8 "X" 00129 #define PRIXLEAST16 "X" 00130 #define PRIXLEAST32 "X" 00131 #define PRIXLEAST64 "I64X" 00132 00133 #define PRIXFAST8 "X" 00134 #define PRIXFAST16 "X" 00135 #define PRIXFAST32 "X" 00136 #define PRIXFAST64 "I64X" 00137 00138 #define PRIXMAX "I64X" 00139 00140 /* 00141 * fscanf macros for signed int types 00142 * NOTE: if 32-bit int is used for int_fast8_t and int_fast16_t 00143 * (see stdint.h, 7.18.1.3), FAST8 and FAST16 should have 00144 * no length identifiers 00145 */ 00146 00147 #define SCNd16 "hd" 00148 #define SCNd32 "d" 00149 #define SCNd64 "I64d" 00150 00151 #define SCNdLEAST16 "hd" 00152 #define SCNdLEAST32 "d" 00153 #define SCNdLEAST64 "I64d" 00154 00155 #define SCNdFAST16 "hd" 00156 #define SCNdFAST32 "d" 00157 #define SCNdFAST64 "I64d" 00158 00159 #define SCNdMAX "I64d" 00160 00161 #define SCNi16 "hi" 00162 #define SCNi32 "i" 00163 #define SCNi64 "I64i" 00164 00165 #define SCNiLEAST16 "hi" 00166 #define SCNiLEAST32 "i" 00167 #define SCNiLEAST64 "I64i" 00168 00169 #define SCNiFAST16 "hi" 00170 #define SCNiFAST32 "i" 00171 #define SCNiFAST64 "I64i" 00172 00173 #define SCNiMAX "I64i" 00174 00175 #define SCNo16 "ho" 00176 #define SCNo32 "o" 00177 #define SCNo64 "I64o" 00178 00179 #define SCNoLEAST16 "ho" 00180 #define SCNoLEAST32 "o" 00181 #define SCNoLEAST64 "I64o" 00182 00183 #define SCNoFAST16 "ho" 00184 #define SCNoFAST32 "o" 00185 #define SCNoFAST64 "I64o" 00186 00187 #define SCNoMAX "I64o" 00188 00189 #define SCNx16 "hx" 00190 #define SCNx32 "x" 00191 #define SCNx64 "I64x" 00192 00193 #define SCNxLEAST16 "hx" 00194 #define SCNxLEAST32 "x" 00195 #define SCNxLEAST64 "I64x" 00196 00197 #define SCNxFAST16 "hx" 00198 #define SCNxFAST32 "x" 00199 #define SCNxFAST64 "I64x" 00200 00201 #define SCNxMAX "I64x" 00202 00203 /* fscanf macros for unsigned int types */ 00204 00205 #define SCNu16 "hu" 00206 #define SCNu32 "u" 00207 #define SCNu64 "I64u" 00208 00209 #define SCNuLEAST16 "hu" 00210 #define SCNuLEAST32 "u" 00211 #define SCNuLEAST64 "I64u" 00212 00213 #define SCNuFAST16 "hu" 00214 #define SCNuFAST32 "u" 00215 #define SCNuFAST64 "I64u" 00216 00217 #define SCNuMAX "I64u" 00218 00219 #ifdef _WIN64 00220 #define PRIdPTR "I64d" 00221 #define PRIiPTR "I64i" 00222 #define PRIoPTR "I64o" 00223 #define PRIuPTR "I64u" 00224 #define PRIxPTR "I64x" 00225 #define PRIXPTR "I64X" 00226 #define SCNdPTR "I64d" 00227 #define SCNiPTR "I64i" 00228 #define SCNoPTR "I64o" 00229 #define SCNxPTR "I64x" 00230 #define SCNuPTR "I64u" 00231 #else 00232 #define PRIdPTR "d" 00233 #define PRIiPTR "i" 00234 #define PRIoPTR "o" 00235 #define PRIuPTR "u" 00236 #define PRIxPTR "x" 00237 #define PRIXPTR "X" 00238 #define SCNdPTR "d" 00239 #define SCNiPTR "i" 00240 #define SCNoPTR "o" 00241 #define SCNxPTR "x" 00242 #define SCNuPTR "u" 00243 #endif 00244 00245 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 00246 /* 00247 * no length modifier for char types prior to C9x 00248 * MS runtime scanf appears to treat "hh" as "h" 00249 */ 00250 00251 /* signed char */ 00252 #define SCNd8 "hhd" 00253 #define SCNdLEAST8 "hhd" 00254 #define SCNdFAST8 "hhd" 00255 00256 #define SCNi8 "hhi" 00257 #define SCNiLEAST8 "hhi" 00258 #define SCNiFAST8 "hhi" 00259 00260 #define SCNo8 "hho" 00261 #define SCNoLEAST8 "hho" 00262 #define SCNoFAST8 "hho" 00263 00264 #define SCNx8 "hhx" 00265 #define SCNxLEAST8 "hhx" 00266 #define SCNxFAST8 "hhx" 00267 00268 /* unsigned char */ 00269 #define SCNu8 "hhu" 00270 #define SCNuLEAST8 "hhu" 00271 #define SCNuFAST8 "hhu" 00272 #endif /* __STDC_VERSION__ >= 199901 */ 00273 00274 #endif /* !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) */ 00275 00276 intmax_t __cdecl imaxabs (intmax_t j); 00277 __CRT_INLINE intmax_t __cdecl imaxabs (intmax_t j) 00278 {return (j >= 0 ? j : -j);} 00279 imaxdiv_t __cdecl imaxdiv (intmax_t numer, intmax_t denom); 00280 00281 /* 7.8.2 Conversion functions for greatest-width integer types */ 00282 00283 intmax_t __cdecl strtoimax (const char* __restrict__ nptr, 00284 char** __restrict__ endptr, int base); 00285 uintmax_t __cdecl strtoumax (const char* __restrict__ nptr, 00286 char** __restrict__ endptr, int base); 00287 00288 intmax_t __cdecl wcstoimax (const wchar_t* __restrict__ nptr, 00289 wchar_t** __restrict__ endptr, int base); 00290 uintmax_t __cdecl wcstoumax (const wchar_t* __restrict__ nptr, 00291 wchar_t** __restrict__ endptr, int base); 00292 00293 #ifdef __cplusplus 00294 } 00295 #endif 00296 00297 #endif /* ndef _INTTYPES_H */ Generated on Sat May 26 2012 04:28:27 for ReactOS by
1.7.6.1
|