Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(772)

Side by Side Diff: Source/WTF/wtf/os-win32/inttypes.h

Issue 14238015: Move Source/WTF/wtf to Source/wtf (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // ISO C9x compliant inttypes.h for Microsoft Visual Studio
2 // Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
3 //
4 // Copyright (c) 2006 Alexander Chemeris
5 //
6 // Redistribution and use in source and binary forms, with or without
7 // modification, are permitted provided that the following conditions are met:
8 //
9 // 1. Redistributions of source code must retain the above copyright notice,
10 // this list of conditions and the following disclaimer.
11 //
12 // 2. Redistributions in binary form must reproduce the above copyright
13 // notice, this list of conditions and the following disclaimer in the
14 // documentation and/or other materials provided with the distribution.
15 //
16 // 3. The name of the author may be used to endorse or promote products
17 // derived from this software without specific prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
20 // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
22 // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 ///////////////////////////////////////////////////////////////////////////////
31
32 #ifndef INTTYPES_WIN32_H
33 #define INTTYPES_WIN32_H
34
35 #include <wtf/Platform.h>
36
37 #if !COMPILER(MSVC)
38 #error "This inttypes.h file should only be compiled with MSVC"
39 #endif
40
41 #ifdef WTF_COMPILER_MSVC7_OR_LOWER
42 // https://bugs.webkit.org/show_bug.cgi?id=76210
43 #error "Visual Studio 2005 or newer is required"
44 #endif
45
46 #if _MSC_VER > 1000
47 #pragma once
48 #endif
49
50 #include "stdint.h"
51
52 // 7.8.1 Macros for format specifiers
53
54 #if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS)
55
56 // The fprintf macros for signed integers are:
57 #define PRId8 "d"
58 #define PRIi8 "i"
59 #define PRIdLEAST8 "d"
60 #define PRIiLEAST8 "i"
61 #define PRIdFAST8 "d"
62 #define PRIiFAST8 "i"
63
64 #define PRId16 "hd"
65 #define PRIi16 "hi"
66 #define PRIdLEAST16 "hd"
67 #define PRIiLEAST16 "hi"
68 #define PRIdFAST16 "hd"
69 #define PRIiFAST16 "hi"
70
71 #define PRId32 "d"
72 #define PRIi32 "i"
73 #define PRIdLEAST32 "d"
74 #define PRIiLEAST32 "i"
75 #define PRIdFAST32 "d"
76 #define PRIiFAST32 "i"
77
78 #define PRId64 "lld"
79 #define PRIi64 "lli"
80 #define PRIdLEAST64 "lld"
81 #define PRIiLEAST64 "lli"
82 #define PRIdFAST64 "lld"
83 #define PRIiFAST64 "lli"
84
85 #define PRIdMAX "lld"
86 #define PRIiMAX "lli"
87
88 #define PRIdPTR "Id"
89 #define PRIiPTR "Ii"
90
91 // The fprintf macros for unsigned integers are:
92 #define PRIo8 "o"
93 #define PRIu8 "u"
94 #define PRIx8 "x"
95 #define PRIX8 "X"
96 #define PRIoLEAST8 "o"
97 #define PRIuLEAST8 "u"
98 #define PRIxLEAST8 "x"
99 #define PRIXLEAST8 "X"
100 #define PRIoFAST8 "o"
101 #define PRIuFAST8 "u"
102 #define PRIxFAST8 "x"
103 #define PRIXFAST8 "X"
104
105 #define PRIo16 "ho"
106 #define PRIu16 "hu"
107 #define PRIx16 "hx"
108 #define PRIX16 "hX"
109 #define PRIoLEAST16 "ho"
110 #define PRIuLEAST16 "hu"
111 #define PRIxLEAST16 "hx"
112 #define PRIXLEAST16 "hX"
113 #define PRIoFAST16 "ho"
114 #define PRIuFAST16 "hu"
115 #define PRIxFAST16 "hx"
116 #define PRIXFAST16 "hX"
117
118 #define PRIo32 "o"
119 #define PRIu32 "u"
120 #define PRIx32 "x"
121 #define PRIX32 "X"
122 #define PRIoLEAST32 "o"
123 #define PRIuLEAST32 "u"
124 #define PRIxLEAST32 "x"
125 #define PRIXLEAST32 "X"
126 #define PRIoFAST32 "o"
127 #define PRIuFAST32 "u"
128 #define PRIxFAST32 "x"
129 #define PRIXFAST32 "X"
130
131 #define PRIo64 "llo"
132 #define PRIu64 "llu"
133 #define PRIx64 "llx"
134 #define PRIX64 "llX"
135 #define PRIoLEAST64 "llo"
136 #define PRIuLEAST64 "llu"
137 #define PRIxLEAST64 "llx"
138 #define PRIXLEAST64 "llX"
139 #define PRIoFAST64 "llo"
140 #define PRIuFAST64 "llu"
141 #define PRIxFAST64 "llx"
142 #define PRIXFAST64 "llX"
143
144 #define PRIoMAX "llo"
145 #define PRIuMAX "llu"
146 #define PRIxMAX "llx"
147 #define PRIXMAX "llX"
148
149 #define PRIoPTR "Io"
150 #define PRIuPTR "Iu"
151 #define PRIxPTR "Ix"
152 #define PRIXPTR "IX"
153
154 // The fscanf macros for signed integers are:
155 #define SCNd8 "d"
156 #define SCNi8 "i"
157 #define SCNdLEAST8 "d"
158 #define SCNiLEAST8 "i"
159 #define SCNdFAST8 "d"
160 #define SCNiFAST8 "i"
161
162 #define SCNd16 "hd"
163 #define SCNi16 "hi"
164 #define SCNdLEAST16 "hd"
165 #define SCNiLEAST16 "hi"
166 #define SCNdFAST16 "hd"
167 #define SCNiFAST16 "hi"
168
169 #define SCNd32 "ld"
170 #define SCNi32 "li"
171 #define SCNdLEAST32 "ld"
172 #define SCNiLEAST32 "li"
173 #define SCNdFAST32 "ld"
174 #define SCNiFAST32 "li"
175
176 #define SCNd64 "lld"
177 #define SCNi64 "lli"
178 #define SCNdLEAST64 "lld"
179 #define SCNiLEAST64 "lli"
180 #define SCNdFAST64 "lld"
181 #define SCNiFAST64 "lli"
182
183 #define SCNdMAX "lld"
184 #define SCNiMAX "lli"
185
186 #ifdef _WIN64
187 # define SCNdPTR "lld"
188 # define SCNiPTR "lli"
189 #else
190 # define SCNdPTR "ld"
191 # define SCNiPTR "li"
192 #endif
193
194 // The fscanf macros for unsigned integers are:
195 #define SCNo8 "o"
196 #define SCNu8 "u"
197 #define SCNx8 "x"
198 #define SCNX8 "X"
199 #define SCNoLEAST8 "o"
200 #define SCNuLEAST8 "u"
201 #define SCNxLEAST8 "x"
202 #define SCNXLEAST8 "X"
203 #define SCNoFAST8 "o"
204 #define SCNuFAST8 "u"
205 #define SCNxFAST8 "x"
206 #define SCNXFAST8 "X"
207
208 #define SCNo16 "ho"
209 #define SCNu16 "hu"
210 #define SCNx16 "hx"
211 #define SCNX16 "hX"
212 #define SCNoLEAST16 "ho"
213 #define SCNuLEAST16 "hu"
214 #define SCNxLEAST16 "hx"
215 #define SCNXLEAST16 "hX"
216 #define SCNoFAST16 "ho"
217 #define SCNuFAST16 "hu"
218 #define SCNxFAST16 "hx"
219 #define SCNXFAST16 "hX"
220
221 #define SCNo32 "lo"
222 #define SCNu32 "lu"
223 #define SCNx32 "lx"
224 #define SCNX32 "lX"
225 #define SCNoLEAST32 "lo"
226 #define SCNuLEAST32 "lu"
227 #define SCNxLEAST32 "lx"
228 #define SCNXLEAST32 "lX"
229 #define SCNoFAST32 "lo"
230 #define SCNuFAST32 "lu"
231 #define SCNxFAST32 "lx"
232 #define SCNXFAST32 "lX"
233
234 #define SCNo64 "llo"
235 #define SCNu64 "llu"
236 #define SCNx64 "llx"
237 #define SCNX64 "llX"
238 #define SCNoLEAST64 "llo"
239 #define SCNuLEAST64 "llu"
240 #define SCNxLEAST64 "llx"
241 #define SCNXLEAST64 "llX"
242 #define SCNoFAST64 "llo"
243 #define SCNuFAST64 "llu"
244 #define SCNxFAST64 "llx"
245 #define SCNXFAST64 "llX"
246
247 #define SCNoMAX "llo"
248 #define SCNuMAX "llu"
249 #define SCNxMAX "llx"
250 #define SCNXMAX "llX"
251
252 #ifdef _WIN64
253 # define SCNoPTR "llo"
254 # define SCNuPTR "llu"
255 # define SCNxPTR "llx"
256 # define SCNXPTR "llX"
257 #else
258 # define SCNoPTR "lo"
259 # define SCNuPTR "lu"
260 # define SCNxPTR "lx"
261 # define SCNXPTR "lX"
262 #endif
263
264 #endif
265
266 #endif
OLDNEW
« no previous file with comments | « Source/WTF/wtf/dtoa/utils.h ('k') | Source/WTF/wtf/os-win32/stdbool.h » ('j') | Source/config.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698