[libvirt] [PATCH] Misc win32 build fixes
Daniel Veillard
veillard at redhat.com
Wed Oct 7 14:16:13 UTC 2009
On Wed, Oct 07, 2009 at 03:08:24PM +0100, Daniel P. Berrange wrote:
> On Wed, Oct 07, 2009 at 03:56:12PM +0200, Daniel Veillard wrote:
> > On Wed, Oct 07, 2009 at 11:42:19AM +0100, Daniel P. Berrange wrote:
> > > * daemon/Makefile.am: Fix missing sasl rule
> > > * src/datatypes.c: Add unistd.h to avoid gnulib bug
> > > * src/util/cgroup.c: Disable mntent if not available
> > > ---
> >
> > ACK, also unification of type we use long long in libvirt to denotate
> > 64 bits ints, it's actually the largest change in that patch.
>
> Opps, I should have mentioned why I did that too...
>
> The PRIi64 constants is intended to expand to the OS specific printf
> format required for a 64 bit integer type. All Win32 runtimes have
> broken 64-bit integer printf support - their definition of PRIi64
> in fact wants a type of 'long' which is only 32bits. libvirt though
> uses GNULIB which provides a replacement printf impl which works
> properly, but it does not replace the PRIi64 constant which still
> refers to the Microsoft impl's requirements. Thus we switch to just
> using the fixed %llu which we know GNULIB guarentees to support, so
> does not need "portability" constants. Of course using int64_t
> with %llu then generates a warning, unless you cast to unsigned long
> long. So in the end the simple solution is just to say
>
> %llu and unsigned long long
>
> everywhere, and ignore all this portability stuff which is not in fact
> portable or reliable
Okay, I basically guessed so except I didn;t know the details of the
PRIx64 breakages, thanks !
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel at veillard.com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
More information about the libvir-list
mailing list