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

Side by Side Diff: runtime/platform/globals.h

Issue 10909103: Move inttypes.h compatibility definitions for Win32 out of globals.h. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: remove uneccessary conditionals Created 8 years, 3 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
« no previous file with comments | « no previous file | runtime/platform/inttypes_support_win.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 #if !defined(ARCH_IS_64_BIT) 104 #if !defined(ARCH_IS_64_BIT)
105 #error Mismatched Host/Target architectures. 105 #error Mismatched Host/Target architectures.
106 #endif 106 #endif
107 #elif defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_ARM) 107 #elif defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_ARM)
108 #if !defined(ARCH_IS_32_BIT) 108 #if !defined(ARCH_IS_32_BIT)
109 #error Mismatched Host/Target architectures. 109 #error Mismatched Host/Target architectures.
110 #endif 110 #endif
111 #endif 111 #endif
112 112
113 113
114 // Printf format specifiers for intptr_t on Windows.
115 #if defined(TARGET_OS_WINDOWS)
116 #if defined(ARCH_IS_32_BIT)
117 #define DART_PRINTF_PTR_PREFIX ""
118 #else
119 #define DART_PRINTF_PTR_PREFIX "ll"
120 #endif
121
122 #if !defined(PRIdPTR)
123 #define PRIdPTR DART_PRINTF_PTR_PREFIX "d"
124 #endif
125
126 #if !defined(PRIuPTR)
127 #define PRIuPTR DART_PRINTF_PTR_PREFIX "u"
128 #endif
129
130 #if !defined(PRIxPTR)
131 #define PRIxPTR DART_PRINTF_PTR_PREFIX "x"
132 #endif
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
146 #endif // defined(TARGET_OS_WINDOWS)
147
148
149 // Short form printf format specifiers 114 // Short form printf format specifiers
150 #define Pd PRIdPTR 115 #define Pd PRIdPTR
151 #define Pu PRIuPTR 116 #define Pu PRIuPTR
152 #define Px PRIxPTR 117 #define Px PRIxPTR
153 #define Pd64 PRId64 118 #define Pd64 PRId64
154 #define Pu64 PRIu64 119 #define Pu64 PRIu64
155 #define Px64 PRIx64 120 #define Px64 PRIx64
156 121
157 122
158 // Suffixes for 64-bit integer literals. 123 // Suffixes for 64-bit integer literals.
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 // have an implicit 'this' argument, the arguments of such methods 360 // have an implicit 'this' argument, the arguments of such methods
396 // should be counted from two, not one." 361 // should be counted from two, not one."
397 // 362 //
398 #define PRINTF_ATTRIBUTE(string_index, first_to_check) \ 363 #define PRINTF_ATTRIBUTE(string_index, first_to_check) \
399 __attribute__((__format__(__printf__, string_index, first_to_check))) 364 __attribute__((__format__(__printf__, string_index, first_to_check)))
400 #else 365 #else
401 #define PRINTF_ATTRIBUTE(string_index, first_to_check) 366 #define PRINTF_ATTRIBUTE(string_index, first_to_check)
402 #endif 367 #endif
403 368
404 #endif // PLATFORM_GLOBALS_H_ 369 #endif // PLATFORM_GLOBALS_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/platform/inttypes_support_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698