Fix build with MinGW due to -Werror
authorSérgio Martins <sergio.martins@kdab.com>
Wed, 10 Dec 2014 22:55:02 +0000 (22:55 +0000)
committerSérgio Martins <sergio.martins@kdab.com>
Wed, 17 Dec 2014 09:36:25 +0000 (10:36 +0100)
On Windows the correct format is %I64d and %I64u:
https://stackoverflow.com/questions/2844/how-do-you-printf-an-unsigned-long-long-int

Similar ifdefs are found in testlib/qtestcase.cpp

Change-Id: Ic65e60f7d391285e292ac8c65944d8af3be205f4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
src/3rdparty/masm/wtf/PrintStream.cpp

index 3bf362e..02dfb11 100644 (file)
@@ -82,12 +82,20 @@ void printInternal(PrintStream& out, unsigned long value)
 
 void printInternal(PrintStream& out, long long value)
 {
+#if OS(WINDOWS)
+    out.printf("%I64d", value);
+#else
     out.printf("%lld", value);
+#endif
 }
 
 void printInternal(PrintStream& out, unsigned long long value)
 {
+#if OS(WINDOWS)
+    out.printf("%I64u", value);
+#else
     out.printf("%llu", value);
+#endif
 }
 
 void printInternal(PrintStream& out, float value)