Re: [PATCH] Fix MinGW build

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/24/2014 06:13 AM, Pavel Hrdina wrote:
> When building on mingw the format string for long long/unsigned long
> long have to be I64d/I64u instead of lld/llu.
> 
> Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
> ---

Yuck.  This is really a problem of the examples directory not taking
advantage of gnulib.  I really don't like this solution.

>          case VIR_TYPED_PARAM_LLONG:
> -            printf("\t%s: %lld\n", params[i].field, params[i].value.l);
> +            printf("\t%s: "LLD_FORMAT"\n", params[i].field, params[i].value.l);

Would it work to include <inttypes.h>, then write this as:

printf("\t%s: %" PRId64 "\n", params[i].field,
       (int64_t) params[i].value.l);

If so, I much prefer that form, as it at least uses standardized
interfaces instead of reinventing a wraparound for the brain-dead
Microsoft printf.


-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]