]> xenbits.xensource.com Git - libvirt.git/commit
build: Fix checkpoint_conf on mingw
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)
commitfed58d83c60ff1c20292856bec006577788b7494
tree1bfba26901cff673359c400cca3ab291e30bf3c4
parenta1be4aaa96f19e10132fca1bb951ed8ef54d9a09
build: Fix checkpoint_conf on mingw

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