|
From: | Anthony Liguori |
Subject: | Re: [Qemu-devel] Mingw GCC not recognising printf format "%I64u" |
Date: | Thu, 29 Jan 2009 09:00:46 -0600 |
User-agent: | Thunderbird 2.0.0.19 (X11/20090105) |
Jamie Lokier wrote:
Anthony Liguori wrote:Or we can just do #ifdef _WIN32 #define PRIu64 "%llu" #endif or whatever the correct format is.Qemu does that already!
I don't think so. mingw32 actuallt defines PRIu64 as "%I64u" even though GCC doesn't like it. FWIW, the following seems to work for me:
/* Mingw has a broken PRIu64 */ #if defined(__MINGW32__) #undef PRIu64 #define PRIu64 "Ld" #endif Regards, Anthony Liguori
It's just it defines the macro to "%I64u" because that's the WIN32 way of writing it...
A quick Google reveals that "%llu" actually doesn't work on Mingw. (Though, if you were compiling on Cygwin (the Linux-like environment for Windows), you must use "%llu". But that also defines _WIN32... ho hum). -- JamieRegards, Anthony LiguoriI won't blame it for not doing so, BeOS didn't have them either (but hey, it was out before C99...).François.
[Prev in Thread] | Current Thread | [Next in Thread] |