[libvirt] [PATCH] always compile iptables.c

Jim Meyering jim at meyering.net
Fri Nov 7 14:34:59 UTC 2008

"Richard W.M. Jones" <rjones at redhat.com> wrote:
> On Fri, Nov 07, 2008 at 02:49:43PM +0100, Jim Meyering wrote:
>> This is slightly different from the previous version.
>> The new part is the addition of the virRun stub to prevent
>> a mingw link failure when building with shared libraries.
>> Now, configured like this, it builds without error:
>> /usr/bin/mingw32-configure --without-sasl --without-avahi \
>>   --without-polkit --without-python --without-xen --without-qemu \
>>   --without-lxc --without-openvz --without-libvirtd \
>>   --prefix=/tmp/libvirt-inst --enable-compile-warnings=maximum
> OK, looks good to me, +1.


> On an unrelated point, probably any usage of __MINGW32__ is suspect, eg:

s/any/any *other*/ ?

>>  #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.

More information about the libvir-list mailing list