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 <eblake@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Eric Blake 2019-07-31 13:48:54 -05:00
parent ca4e86cac2
commit 8a8e86564a
2 changed files with 3 additions and 2 deletions

View File

@ -21,8 +21,6 @@
#include <config.h>
#include <unistd.h>
#include "configmake.h"
#include "internal.h"
#include "virbitmap.h"

View 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)