mirror of
https://github.com/mii443/qemu.git
synced 2025-08-23 23:49:36 +00:00
json: fix PRId64 on Win32
OK we are fooled by the json lexer and parser. As we use %I64d to print 'long long' variables in Win32, but lexer and parser only deal with %lld but not %I64d, this patch add support for %I64d and solve 'info pci', 'powser_reset' and 'power_powerdown' assert failure in Win32. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
@ -474,7 +474,8 @@ static QObject *parse_escape(JSONParserContext *ctxt, QList **tokens, va_list *a
|
||||
obj = QOBJECT(qint_from_int(va_arg(*ap, int)));
|
||||
} else if (token_is_escape(token, "%ld")) {
|
||||
obj = QOBJECT(qint_from_int(va_arg(*ap, long)));
|
||||
} else if (token_is_escape(token, "%lld")) {
|
||||
} else if (token_is_escape(token, "%lld") ||
|
||||
token_is_escape(token, "%I64d")) {
|
||||
obj = QOBJECT(qint_from_int(va_arg(*ap, long long)));
|
||||
} else if (token_is_escape(token, "%s")) {
|
||||
obj = QOBJECT(qstring_from_str(va_arg(*ap, const char *)));
|
||||
|
Reference in New Issue
Block a user