From 8a8e86564ac22792d9abcd33c16c25493ca4ab2e Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Wed, 31 Jul 2019 13:48:54 -0500 Subject: [PATCH] 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 --- src/conf/checkpoint_conf.c | 2 -- src/util/viratomic.h | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) 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)