Details
Description
GCC (since 4.3 AFAIK) contains cpuid.h which defines _get_cpuid(...) and __cpuid(level, a, b, c, d).
intrin.h is Windows-API which defines __cpuid(int CPUInfo[4], int InfoType)
Definitions of __cpuid are clearly not compatible.
However when cross-compiling with GCC-mingw for Windows, configure script detects existence of both cpuid.h and intrin.h and includes both in PlatformUtils.cpp
Following trivial patch workarounds this problem.
diff -ur xerces-c-3.1.0/src/xercesc/util/PlatformUtils.cpp xerces-c-3.1.0.patched/src/xercesc/util/PlatformUtils.cpp
— xerces-c-3.1.0/src/xercesc/util/PlatformUtils.cpp 2009-08-28 16:21:24.000000000 +0300
+++ xerces-c-3.1.0.patched/src/xercesc/util/PlatformUtils.cpp 2010-02-15 11:16:33.000000000 +0200
@@ -37,7 +37,7 @@
#if HAVE_SYS_TIMEB_H
- include <sys/timeb.h>
#endif
-#if HAVE_CPUID_H
+#if HAVE_CPUID_H && !XERCES_HAVE_INTRIN_H - include <cpuid.h>
#endif