]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
build: Fix checkpoint_conf on mingw v5.6.0-rc1
authorEric Blake <eblake@redhat.com>
Mon, 29 Jul 2019 18:00:44 +0000 (13:00 -0500)
committerEric Blake <eblake@redhat.com>
Mon, 29 Jul 2019 18:06:39 +0000 (13:06 -0500)
CI flagged a failing mingw build, due to:
In file included from ../../src/conf/checkpoint_conf.c:24:
../gnulib/lib/configmake.h:8:17: error: expected identifier or '(' before string constant
    8 | #define DATADIR "/usr/i686-w64-mingw32/sys-root/mingw/share"
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

As previously learned in commits bd205a90 and 976abdf6, gnulib's
configmake.h header does #define DATADIR "string...", while mingw's
<winsock2.h> expects to declare a type named DATADIR. As long as the
mingw system header is included first before configmake.h, the two
uses do not conflict, but until gnulib is patched to make configmake.h
automatically work around the issue, our immediate fix is the
workaround of rearranging our include order to insure no conflict.
Copy the paradigm used in domain_conf.c of using <unistd.h> to trigger
the indirect inclusion of <winsock2.h> on mingw.

Fixes: 1a4df34a
Signed-off-by: Eric Blake <eblake@redhat.com>
src/conf/checkpoint_conf.c

index 5f4c275dd86aba57e536f2fe866864d55e236a83..5ce4cc485359379eae0c597a66ee05aac223e152 100644 (file)
@@ -21,6 +21,8 @@
 
 #include <config.h>
 
+#include <unistd.h>
+
 #include "configmake.h"
 #include "internal.h"
 #include "virbitmap.h"