]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
build: fix build on mingw with netcf available
authorEric Blake <eblake@redhat.com>
Wed, 11 Jan 2012 13:48:14 +0000 (06:48 -0700)
committerEric Blake <eblake@redhat.com>
Wed, 11 Jan 2012 14:54:10 +0000 (07:54 -0700)
The autobuilder pointed out an odd failure on mingw:
../../src/interface/netcf_driver.c:644:5: error: unknown field 'close_used_without_including_unistd_h' specified in initializer
cc1: warnings being treated as errors

This is because the gnulib headers #define close to different strings,
according to which headers are included, in order to work around some
odd mingw problems with close(), and these defines happen to also
affect field members declared with a name of struct foo.close. As long
as all headers are included before both the definition and use of the
struct, the various #define doesn't matter, but the netcf file hit
an instance where things were included in a different order.  Fix this
for all clients that use a struct member named 'close'.

* src/driver.h: Include <unistd.h> before using 'close'.

src/driver.h

index ec4abf3e4e3730459a405946c5c62fc9687156ff..24636a43a21fba210a6aeede2f0c7f80e0706031 100644 (file)
@@ -8,6 +8,7 @@
 
 # include "config.h"
 
+# include <unistd.h>
 # include <libxml/uri.h>
 
 # include "internal.h"