[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH] mingw32: Fix definitions for PRId64, PRIx64, P
From: |
Blue Swirl |
Subject: |
[Qemu-devel] Re: [PATCH] mingw32: Fix definitions for PRId64, PRIx64, PRIu64, PRIo64 |
Date: |
Sun, 30 Jan 2011 21:39:54 +0000 |
On Sun, Jan 30, 2011 at 9:27 PM, Stefan Weil <address@hidden> wrote:
> Am 04.12.2010 20:41, schrieb Stefan Weil:
>>
>> QEMU always uses POSIX format specifiers, even with mingw32.
>>
>> Therefore the old definitions of the PRI*64 macros were wrong.
>> They should be removed, but as long as the mingw32 system
>> include inttypes.h provides wrong definitions, too,
>> we correct them here.
>>
>> Cc: Blue Swirl <address@hidden>
>> Signed-off-by: Stefan Weil <address@hidden>
>> ---
>> qemu-common.h | 16 ++++++++++++----
>> 1 files changed, 12 insertions(+), 4 deletions(-)
>>
>> diff --git a/qemu-common.h b/qemu-common.h
>> index de82c2e..c739f45 100644
>> --- a/qemu-common.h
>> +++ b/qemu-common.h
>> @@ -96,10 +96,18 @@ static inline char *realpath(const char *path, char
>> *resolved_path)
>> return resolved_path;
>> }
>>
>> -#define PRId64 "I64d"
>> -#define PRIx64 "I64x"
>> -#define PRIu64 "I64u"
>> -#define PRIo64 "I64o"
>> +/* inttypes.h (mingw32) provides wrong definitions, so fix them here. */
>> +/* TODO: remove this workaround as soon as mingw32 is fixed. */
>> +
>> +#undef PRId64
>> +#undef PRIx64
>> +#undef PRIu64
>> +#undef PRIo64
>> +
>> +#define PRId64 "lld"
>> +#define PRIx64 "llx"
>> +#define PRIu64 "llu"
>> +#define PRIo64 "llo"
>> #endif
>>
>> /* FIXME: Remove NEED_CPU_H. */
>
> What about this patch? It is still missing in QEMU git master.
It would appear to suppress quite a few warnings about formats. But on
my version of inttypes.h there is the following comment:
/* 7.8.1 Macros for format specifiers
*
* MS runtime does not yet understand C9x standard "ll"
* length specifier. It appears to treat "ll" as "l".
* The non-standard I64 length specifier causes warning in GCC,
* but understood by MS runtime functions.
*/
So is this change OK after all?
- [Qemu-devel] Re: [PATCH] mingw32: Fix definitions for PRId64, PRIx64, PRIu64, PRIo64, Stefan Weil, 2011/01/30
- [Qemu-devel] Re: [PATCH] mingw32: Fix definitions for PRId64, PRIx64, PRIu64, PRIo64,
Blue Swirl <=
- [Qemu-devel] Re: [PATCH] mingw32: Fix definitions for PRId64, PRIx64, PRIu64, PRIo64, Stefan Weil, 2011/01/30
- [Qemu-devel] Re: [PATCH] mingw32: Fix definitions for PRId64, PRIx64, PRIu64, PRIo64, Blue Swirl, 2011/01/30
- Re: [Qemu-devel] Re: [PATCH] mingw32: Fix definitions for PRId64, PRIx64, PRIu64, PRIo64, Mark Cave-Ayland, 2011/01/31
- [Qemu-devel] Re: [PATCH] mingw32: Fix definitions for PRId64, PRIx64, PRIu64, PRIo64, Stefan Weil, 2011/01/31
- Prev by Date:
[Qemu-devel] Re: [PATCH] mingw32: Fix definitions for PRId64, PRIx64, PRIu64, PRIo64
- Next by Date:
[Qemu-devel] Re: [PATCH] mingw32: Fix definitions for PRId64, PRIx64, PRIu64, PRIo64
- Previous by thread:
[Qemu-devel] Re: [PATCH] mingw32: Fix definitions for PRId64, PRIx64, PRIu64, PRIo64
- Next by thread:
[Qemu-devel] Re: [PATCH] mingw32: Fix definitions for PRId64, PRIx64, PRIu64, PRIo64
- Index(es):