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

Unified Diff: runtime/platform/globals.h

Issue 10834155: Reapply "Use platform-independent format specifiers when disassembling code objects." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/include/dart_api.h ('k') | runtime/vm/compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/platform/globals.h
diff --git a/runtime/platform/globals.h b/runtime/platform/globals.h
index 415e6c35a3cef82c5d92a3458bbecc64ee11b6dd..8ca5065ac611dbb17eca14bf79e35bcd4d00e33d 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,23 @@
#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)
#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
+
+#endif // defined(TARGET_OS_WINDOWS)
// Suffixes for 64-bit integer literals.
« no previous file with comments | « runtime/include/dart_api.h ('k') | runtime/vm/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698