]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
build: Solve mingw build clash with DATADIR
authorEric Blake <eblake@redhat.com>
Wed, 31 Jul 2019 18:48:54 +0000 (13:48 -0500)
committerEric Blake <eblake@redhat.com>
Thu, 8 Aug 2019 01:21:05 +0000 (20:21 -0500)
Commit fed58d83 was a hack to fix a mingw build failure due to header
inclusion order resulting in a clash over the use of DATADIR,
repeating a trick made several other times in the past.  Better is to
revert that, and instead use pragmas to avoid the clash in the first
place, regardless of header ordering, solving it for everyone.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/conf/checkpoint_conf.c
src/util/viratomic.h

index 5ce4cc485359379eae0c597a66ee05aac223e152..5f4c275dd86aba57e536f2fe866864d55e236a83 100644 (file)
@@ -21,8 +21,6 @@
 
 #include <config.h>
 
-#include <unistd.h>
-
 #include "configmake.h"
 #include "internal.h"
 #include "virbitmap.h"
index 35800dafcd22705f0eed06139c594eb70ba485c8..c6e7668324830c031ad1ce22736d574c4f7606b6 100644 (file)
@@ -218,7 +218,10 @@ VIR_STATIC unsigned int virAtomicIntXor(volatile unsigned int *atomic,
 
 # ifdef VIR_ATOMIC_OPS_WIN32
 
+#  pragma push_macro("DATADIR") /* If "configmake.h" was included first */
+#  undef DATADIR
 #  include <winsock2.h>
+#  pragma pop_macro("DATADIR")
 #  include <windows.h>
 #  include <intrin.h>
 #  if !defined(_M_AMD64) && !defined (_M_IA64) && !defined(_M_X64)