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

[libvirt] [PATCH] build: fix build on mingw with netcf available



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 in order to work
around some odd mingw problems with close(), but it happens to
also affect field members declared with a name of struct foo.close.
As long as the same headers are included for the definition and use
of the struct, the #define doesn't matter, but the netcf file hit
an instance where things were 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'.
---

I don't have netcf for mingw locally, so I'd like a review before
pushing this, since I couldn't confirm whether it fixed the
broken build on the autobuilder.

 src/driver.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/driver.h b/src/driver.h
index ec4abf3..24636a4 100644
--- a/src/driver.h
+++ b/src/driver.h
@@ -8,6 +8,7 @@

 # include "config.h"

+# include <unistd.h>
 # include <libxml/uri.h>

 # include "internal.h"
-- 
1.7.7.5


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