[libvirt] [PATCH v2] examples: fix 64-bit integer formatting on Windows
Michal Privoznik
mprivozn at redhat.com
Tue Apr 2 12:16:33 UTC 2019
On 4/2/19 11:24 AM, Daniel P. Berrangé wrote:
> The Windows printf functions don't support %llu/%lld for printing 64-bit
> integers. For most of libvirt this doesn't matter as we rely on gnulib
> which provides a replacement printf that is sane.
>
> The example code is designed to compile against the normal OS headers,
> with no use of gnulib and thus has to use the platform specific printf.
> To deal with this we must use the macros PRI* macros from inttypes.h
> to get the platform specific format string.
>
> Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
> ---
> examples/admin/client_info.c | 7 ++++---
> examples/admin/list_clients.c | 3 ++-
> examples/domtop/domtop.c | 8 ++++++--
> 3 files changed, 12 insertions(+), 6 deletions(-)
>
> Changed in v2:
>
> - Now actually commit the int64 casts
ACK
Michal
More information about the libvir-list
mailing list