forked from qt-creator/qt-creator
When running on MacOS, undefine __BLOCKS__ in the preprocessor flags of the C++ parser.
We don't support blocks yet, and this way we get rid of quite some parsing errors (resulting in undefined or wrongly defined types, messing up the semantic passes). Reviewed-by: Roberto Raggi
This commit is contained in:
@@ -174,6 +174,14 @@ QByteArray GccToolChain::predefinedMacros()
|
||||
cpp.closeWriteChannel();
|
||||
cpp.waitForFinished();
|
||||
m_predefinedMacros = cpp.readAllStandardOutput();
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
int idx = m_predefinedMacros.indexOf("#define __BLOCKS__ 1");
|
||||
if (idx != -1) {
|
||||
idx = m_predefinedMacros.indexOf("1", idx);
|
||||
m_predefinedMacros[idx] = '0';
|
||||
}
|
||||
#endif // Q_OS_MAC
|
||||
}
|
||||
return m_predefinedMacros;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user