Attention is currently required from: Mark Mentovai.
To view, visit change 4942896. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Peter Kasting.
Patch set 1:Code-Review +1
Mark Mentovai submitted this change.
Use POSIX format specifiers on Windows.
MSVC (and clang-cl) have supported these for ~8 years. This change
brings this header close to the upstream one in Chromium.
Bug: 1371963
Change-Id: I6efb7bc922461fca9c211f32feb51fd8171c1478
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/mini_chromium/+/4942896
Reviewed-by: Mark Mentovai <ma...@chromium.org>
---
M base/format_macros.h
1 file changed, 3 insertions(+), 34 deletions(-)
diff --git a/base/format_macros.h b/base/format_macros.h
index 0cf2f00..b273a2e 100644
--- a/base/format_macros.h
+++ b/base/format_macros.h
@@ -23,25 +23,18 @@
#include "build/build_config.h"
-#if BUILDFLAG(IS_POSIX)
-
-#if (defined(_INTTYPES_H) || defined(_INTTYPES_H_)) && !defined(PRId64)
+#if BUILDFLAG(IS_POSIX) && \
+ (defined(_INTTYPES_H) || defined(_INTTYPES_H_)) && !defined(PRId64)
#error "inttypes.h has already been included before this header file, but "
#error "without __STDC_FORMAT_MACROS defined."
#endif
-#if !defined(__STDC_FORMAT_MACROS)
+#if BUILDFLAG(IS_POSIX) && !defined(__STDC_FORMAT_MACROS)
#define __STDC_FORMAT_MACROS
#endif
#include <inttypes.h>
-// GCC will concatenate wide and narrow strings correctly, so nothing needs to
-// be done here.
-#define WidePRId64 PRId64
-#define WidePRIu64 PRIu64
-#define WidePRIx64 PRIx64
-
#if !defined(PRIuS)
#define PRIuS "zu"
#endif
@@ -74,28 +67,4 @@
#endif
#endif // BUILDFLAG(IS_APPLE)
-#else // BUILDFLAG(IS_WIN)
-
-#if !defined(PRId64)
-#define PRId64 "I64d"
-#endif
-
-#if !defined(PRIu64)
-#define PRIu64 "I64u"
-#endif
-
-#if !defined(PRIx64)
-#define PRIx64 "I64x"
-#endif
-
-#define WidePRId64 L"I64d"
-#define WidePRIu64 L"I64u"
-#define WidePRIx64 L"I64x"
-
-#if !defined(PRIuS)
-#define PRIuS "Iu"
-#endif
-
-#endif
-
#endif // BASE_FORMAT_MACROS_H_
To view, visit change 4942896. To unsubscribe, or for help writing mail filters, visit settings.