summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppprojects.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/cpptools/cppprojects.cpp')
-rw-r--r--src/plugins/cpptools/cppprojects.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/plugins/cpptools/cppprojects.cpp b/src/plugins/cpptools/cppprojects.cpp
index 9e088288a8..bf1b532a94 100644
--- a/src/plugins/cpptools/cppprojects.cpp
+++ b/src/plugins/cpptools/cppprojects.cpp
@@ -510,9 +510,17 @@ QStringList CompilerOptionsBuilder::createDefineOptions(const QByteArray &define
bool toolchainDefines,
const QString &toolchainType)
{
+ QByteArray extendedDefines = defines;
QStringList result;
- foreach (QByteArray def, defines.split('\n')) {
+ // In gcc headers, lots of built-ins are referenced that clang does not understand.
+ // Therefore, prevent the inclusion of the header that references them. Of course, this
+ // will break if code actually requires stuff from there, but that should be the less common
+ // case.
+ if (toolchainType == QLatin1String("mingw") || toolchainType == QLatin1String("gcc"))
+ extendedDefines += "#define _X86INTRIN_H_INCLUDED\n";
+
+ foreach (QByteArray def, extendedDefines.split('\n')) {
if (def.isEmpty())
continue;