From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LSYOC-0005if-Dc for qemu-devel@nongnu.org; Thu, 29 Jan 2009 10:01:08 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LSYO9-0005hh-T6 for qemu-devel@nongnu.org; Thu, 29 Jan 2009 10:01:07 -0500 Received: from [199.232.76.173] (port=56885 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LSYO9-0005hR-Jx for qemu-devel@nongnu.org; Thu, 29 Jan 2009 10:01:05 -0500 Received: from qw-out-1920.google.com ([74.125.92.145]:35401) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LSYO9-0006LM-4D for qemu-devel@nongnu.org; Thu, 29 Jan 2009 10:01:05 -0500 Received: by qw-out-1920.google.com with SMTP id 5so1546753qwc.4 for ; Thu, 29 Jan 2009 07:01:03 -0800 (PST) Message-ID: <4981C49E.5070207@codemonkey.ws> Date: Thu, 29 Jan 2009 09:00:46 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] Mingw GCC not recognising printf format "%I64u" References: <1987955410-BeMail@laptop> <4981B0C9.8010403@codemonkey.ws> <20090129135523.GA7441@shareable.org> In-Reply-To: <20090129135523.GA7441@shareable.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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). > > -- Jamie > > > >> Regards, >> >> Anthony Liguori >> >> >>> I won't blame it for not doing so, BeOS didn't have them either (but >>> hey, it was out before C99...). >>> >>> François. >>> >>> >>> >>> >> >> > > >