Conflicting includes cpuid.h and intrin.h (both define __cpuid)
---------------------------------------------------------------
Key: XERCESC-1912
URL: https://issues.apache.org/jira/browse/XERCESC-1912
Project: Xerces-C++
Issue Type: Bug
Components: Build
Affects Versions: 3.1.0
Environment: GCC 4.4 (mingw) with mingw-w64 environment (64-bit,
cross-compiling under Debian GNU/Linux)
Reporter: Tommi Vainikainen
Priority: Minor
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
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]