Changed BLOCKS undef on MacOS to work with system header files.

This commit is contained in:
Erik Verbruggen
2010-02-15 16:23:32 +01:00
parent e3e6797fe5
commit 070d06c163

View File

@@ -177,10 +177,11 @@ QByteArray GccToolChain::predefinedMacros()
#ifdef Q_OS_MAC
// Turn off flag indicating Apple's blocks support
int idx = m_predefinedMacros.indexOf("#define __BLOCKS__ 1");
const QByteArray blocksDefine("#define __BLOCKS__ 1");
const QByteArray blocksUndefine("#undef __BLOCKS__");
int idx = m_predefinedMacros.indexOf(blocksDefine);
if (idx != -1) {
idx = m_predefinedMacros.indexOf('1', idx);
m_predefinedMacros[idx] = '0';
m_predefinedMacros.replace(idx, blocksDefine.length(), blocksUndefine);
}
// Define __strong and __weak (used for Apple's GC extension of C) to be empty