Bug 1368406 Use non-Windows Printf Format Specifiers in MinGW r=froydnj
authorTom Ritter <tom@mozilla.com>
Mon, 29 May 2017 00:38:57 -0500
changeset 361298 6909c7487def14b559d00c5181c403e36d09ee62
parent 361297 c6fb400017f150d652c0b2b01f8d619f58c82931
child 361299 07f07bc1e39a02f1d9b2e0381ca4935ded3ca13e
push id31924
push userryanvm@gmail.com
push dateTue, 30 May 2017 20:08:50 +0000
treeherdermozilla-central@692e277e2b9f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1368406
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1368406 Use non-Windows Printf Format Specifiers in MinGW r=froydnj MinGW applies the gnu_printf format attribute, which expects non-Windows format specifiers. These macros were not designed to handle MinGW. MozReview-Commit-ID: HuJrK43Bg1A
mfbt/SizePrintfMacros.h
--- a/mfbt/SizePrintfMacros.h
+++ b/mfbt/SizePrintfMacros.h
@@ -13,17 +13,17 @@
  * MSVC's libc does not support C99's %z format length modifier for size_t
  * types. Instead, we use Microsoft's nonstandard %I modifier for size_t, which
  * is unsigned __int32 on 32-bit platforms and unsigned __int64 on 64-bit
  * platforms:
  *
  * http://msdn.microsoft.com/en-us/library/tcxf1dw6.aspx
  */
 
-#if defined(XP_WIN)
+#if defined(XP_WIN) && !defined(__MINGW32__)
 #  define PRIoSIZE  "Io"
 #  define PRIuSIZE  "Iu"
 #  define PRIxSIZE  "Ix"
 #  define PRIXSIZE  "IX"
 #else
 #  define PRIoSIZE  "zo"
 #  define PRIuSIZE  "zu"
 #  define PRIxSIZE  "zx"