[libvirt] [PATCH] always compile iptables.c

Richard W.M. Jones rjones at redhat.com
Fri Nov 7 15:49:53 UTC 2008

On Fri, Nov 07, 2008 at 03:34:59PM +0100, Jim Meyering wrote:
> "Richard W.M. Jones" <rjones at redhat.com> wrote:
> > On an unrelated point, probably any usage of __MINGW32__ is suspect, eg:
> s/any/any *other*/ ?

I'm pretty sure "any", in this case too.

> >>  #else /* __MINGW32__ */
> >
> > Our MinGW cross-compiler defines the symbol 'WIN32', and so do all
> > compilers on Windows itself[1][2].
> >
> > Therefore it's better to use #ifdef WIN32 ... #endif for any code that
> > is specific to the Win32 API.
> >
> > The __MINGW32__ symbol has a place for code which is specific to the
> > MinGW version of GCC, eg. if it had a bug that we needed to work
> > around.
> In the case of lstat, that use of __MINGW32__ is deliberate, since
> the guarded code is needed only on mingw, and not on cygwin.
> So using WIN32 there would be wrong.

Cygwin isn't like other Windows compilers -- it exposes a Unix/POSIX
API (not Win32 which is a completely different API, even though some
of the calls happen to look superficially similar).

Cygwin doesn't define WIN32 symbol[1], so using WIN32 here should be OK.

Anyway, I don't think anyone is using Cygwin to compile libvirt.  The
licensing issues alone mean that it'd be unacceptable to most of our


[1] Well, that's not entirely true: if you use Cygwin and then include
<windows.h>, you do get WIN32 symbol defined, because by doing this
you've got both POSIX _and_ Win32 APIs available.  WIN32 tells you
that the Win32 API is available, not that POSIX is unavailable.

Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into Xen guests.

More information about the libvir-list mailing list