OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef PLATFORM_GLOBALS_H_ | 5 #ifndef PLATFORM_GLOBALS_H_ |
6 #define PLATFORM_GLOBALS_H_ | 6 #define PLATFORM_GLOBALS_H_ |
7 | 7 |
8 // __STDC_FORMAT_MACROS has to be defined before including <inttypes.h> to | 8 // __STDC_FORMAT_MACROS has to be defined before including <inttypes.h> to |
9 // enable platform independent printf format specifiers. | 9 // enable platform independent printf format specifiers. |
10 #ifndef __STDC_FORMAT_MACROS | 10 #ifndef __STDC_FORMAT_MACROS |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 #if defined(ARCH_IS_32_BIT) | 116 #if defined(ARCH_IS_32_BIT) |
117 #define DART_PRINTF_PTR_PREFIX "" | 117 #define DART_PRINTF_PTR_PREFIX "" |
118 #else | 118 #else |
119 #define DART_PRINTF_PTR_PREFIX "ll" | 119 #define DART_PRINTF_PTR_PREFIX "ll" |
120 #endif | 120 #endif |
121 | 121 |
122 #if !defined(PRIdPTR) | 122 #if !defined(PRIdPTR) |
123 #define PRIdPTR DART_PRINTF_PTR_PREFIX "d" | 123 #define PRIdPTR DART_PRINTF_PTR_PREFIX "d" |
124 #endif | 124 #endif |
125 | 125 |
| 126 #if !defined(PRIuPTR) |
| 127 #define PRIuPTR DART_PRINTF_PTR_PREFIX "u" |
| 128 #endif |
| 129 |
126 #if !defined(PRIxPTR) | 130 #if !defined(PRIxPTR) |
127 #define PRIxPTR DART_PRINTF_PTR_PREFIX "x" | 131 #define PRIxPTR DART_PRINTF_PTR_PREFIX "x" |
128 #endif | 132 #endif |
129 | 133 |
| 134 #if !defined(PRId64) |
| 135 #define PRId64 I64d |
| 136 #endif |
| 137 |
| 138 #if !defined(PRIu64) |
| 139 #define PRIu64 I64u |
| 140 #endif |
| 141 |
| 142 #if !defined(PRIx64) |
| 143 #define PRIx64 I64x |
| 144 #endif |
| 145 |
130 #endif // defined(TARGET_OS_WINDOWS) | 146 #endif // defined(TARGET_OS_WINDOWS) |
131 | 147 |
132 | 148 |
133 // Short form printf format specifiers | 149 // Short form printf format specifiers |
134 #define Pd PRIdPTR | 150 #define Pd PRIdPTR |
135 #define Pu PRIuPTR | 151 #define Pu PRIuPTR |
136 #define Px PRIxPTR | 152 #define Px PRIxPTR |
137 #define Pd64 PRId64 | 153 #define Pd64 PRId64 |
138 #define Pu64 PRIu64 | 154 #define Pu64 PRIu64 |
139 #define Px64 PRIx64 | 155 #define Px64 PRIx64 |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 // have an implicit 'this' argument, the arguments of such methods | 395 // have an implicit 'this' argument, the arguments of such methods |
380 // should be counted from two, not one." | 396 // should be counted from two, not one." |
381 // | 397 // |
382 #define PRINTF_ATTRIBUTE(string_index, first_to_check) \ | 398 #define PRINTF_ATTRIBUTE(string_index, first_to_check) \ |
383 __attribute__((__format__(__printf__, string_index, first_to_check))) | 399 __attribute__((__format__(__printf__, string_index, first_to_check))) |
384 #else | 400 #else |
385 #define PRINTF_ATTRIBUTE(string_index, first_to_check) | 401 #define PRINTF_ATTRIBUTE(string_index, first_to_check) |
386 #endif | 402 #endif |
387 | 403 |
388 #endif // PLATFORM_GLOBALS_H_ | 404 #endif // PLATFORM_GLOBALS_H_ |
OLD | NEW |