From: Eric Blake Date: Wed, 31 Jul 2019 18:48:54 +0000 (-0500) Subject: build: Solve mingw build clash with DATADIR X-Git-Tag: v5.7.0-rc1~338 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a8e86564ac22792d9abcd33c16c25493ca4ab2e;p=thirdparty%2Flibvirt.git build: Solve mingw build clash with DATADIR 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 Reviewed-by: Michal Privoznik --- diff --git a/src/conf/checkpoint_conf.c b/src/conf/checkpoint_conf.c index 5ce4cc4853..5f4c275dd8 100644 --- a/src/conf/checkpoint_conf.c +++ b/src/conf/checkpoint_conf.c @@ -21,8 +21,6 @@ #include -#include - #include "configmake.h" #include "internal.h" #include "virbitmap.h" diff --git a/src/util/viratomic.h b/src/util/viratomic.h index 35800dafcd..c6e7668324 100644 --- a/src/util/viratomic.h +++ b/src/util/viratomic.h @@ -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 +# pragma pop_macro("DATADIR") # include # include # if !defined(_M_AMD64) && !defined (_M_IA64) && !defined(_M_X64)