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:
Erik Verbruggen
2010-01-22 09:33:34 +01:00
parent 68a8b6a663
commit 9ea5264edd

View File

@@ -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;
}