moc: force the Microsoft compiler not to define _MSC_EXTENSIONS

This re-fixes commit d72ac3f35f, which
simply removed the #define but did so at the wrong place. Instead of
forcing the macro to be removed, let's simply not have it defined in the
first place.

Change-Id: Ie6dbad9bbbd9488887e8fffd148dd67d9a31b32e
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
This commit is contained in:
Thiago Macieira 2016-12-06 17:54:47 -08:00 committed by Jani Heikkinen
parent 093e1111ef
commit e1a70ce495
2 changed files with 2 additions and 5 deletions

View File

@ -31,10 +31,10 @@ if(gcc|intel_icl|msvc):!rim_qcc:!uikit {
moc_predefs.name = "Generate moc_predefs.h" moc_predefs.name = "Generate moc_predefs.h"
moc_predefs.CONFIG = no_link moc_predefs.CONFIG = no_link
gcc: moc_predefs.commands = $$QMAKE_CXX $$QMAKE_CXXFLAGS -dM -E -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN} gcc: moc_predefs.commands = $$QMAKE_CXX $$QMAKE_CXXFLAGS -dM -E -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
else:intel_icl: moc_predefs.commands = $$QMAKE_CXX $$QMAKE_CXXFLAGS -QdM -P -Fi${QMAKE_FILE_OUT} ${QMAKE_FILE_IN} else:intel_icl: moc_predefs.commands = $$QMAKE_CXX $$QMAKE_CXXFLAGS -QdM -P -Za -Fi${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
else:msvc { else:msvc {
moc_predefs.commands += $$QMAKE_CXX -Bx$$shell_quote($$shell_path($$QMAKE_QMAKE)) $$QMAKE_CXXFLAGS \ moc_predefs.commands += $$QMAKE_CXX -Bx$$shell_quote($$shell_path($$QMAKE_QMAKE)) $$QMAKE_CXXFLAGS \
-E ${QMAKE_FILE_IN} 2>NUL >${QMAKE_FILE_OUT} -E -Za ${QMAKE_FILE_IN} 2>NUL >${QMAKE_FILE_OUT}
} else: error("Oops, I messed up") } else: error("Oops, I messed up")
moc_predefs.output = $$MOC_DIR/moc_predefs.h moc_predefs.output = $$MOC_DIR/moc_predefs.h
moc_predefs.input = MOC_PREDEF_FILE moc_predefs.input = MOC_PREDEF_FILE

View File

@ -477,9 +477,6 @@ int runMoc(int argc, char **argv)
} }
moc.symbols += pp.preprocessed(moc.filename, &in); moc.symbols += pp.preprocessed(moc.filename, &in);
// We obviously do not support MS extensions
pp.macros.remove("_MSC_EXTENSIONS");
if (!pp.preprocessOnly) { if (!pp.preprocessOnly) {
// 2. parse // 2. parse
moc.parse(); moc.parse();