Index: runtime/platform/globals.h |
diff --git a/runtime/platform/globals.h b/runtime/platform/globals.h |
index 415e6c35a3cef82c5d92a3458bbecc64ee11b6dd..4988ab8c9548ac4ae9310d7ae9dff56b951a099c 100644 |
--- a/runtime/platform/globals.h |
+++ b/runtime/platform/globals.h |
@@ -5,7 +5,8 @@ |
#ifndef PLATFORM_GLOBALS_H_ |
#define PLATFORM_GLOBALS_H_ |
-// __STDC_FORMAT_MACROS has to be defined to enable platform independent printf. |
+// __STDC_FORMAT_MACROS has to be defined before including <inttypes.h> to |
+// enable platform independent printf format specifiers. |
#ifndef __STDC_FORMAT_MACROS |
#define __STDC_FORMAT_MACROS |
#endif |
@@ -108,14 +109,24 @@ |
#endif |
-// Printf format for intptr_t on Windows. |
-#if !defined(PRIxPTR) && defined(TARGET_OS_WINDOWS) |
+// Printf format specifiers for intptr_t on Windows. |
+#if defined(TARGET_OS_WINDOWS) |
Kevin Millikin (Google)
2012/08/02 14:57:27
PRIdPTR was not defined here before. PRIdPTR shou
|
#if defined(ARCH_IS_32_BIT) |
-#define PRIxPTR "x" |
+#define DART_PRINTF_PTR_PREFIX "" |
#else |
-#define PRIxPTR "llx" |
-#endif // defined(ARCH_IS_32_BIT) |
-#endif // !defined(PRIxPTR) && defined(TARGET_OS_WINDOWS) |
+#define DART_PRINTF_PTR_PREFIX "ll" |
+#endif |
+ |
+#if !defined(PRIdPTR) |
+#define PRIdPTR DART_PRINTF_PTR_PREFIX "d" |
+#endif |
+ |
+#if !defined(PRIxPTR) |
+#define PRIxPTR DART_PRINTF_PTR_PREFIX "x" |
+#endif |
+ |
+#undef DART_PRINTF_PTR_PREFIX |
+#endif // defined(TARGET_OS_WINDOWS) |
// Suffixes for 64-bit integer literals. |