From c3030d7163245b55abfd09eefe696c035c55011c Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 23 May 2017 11:07:11 +0200 Subject: moc: remove _MSC_EXTENSIONS #define Because we obviously don't support Microsoft's extensions in C++. This is required because some MS headers have code that isn't proper C++, like iso646.h: #if !defined(__cplusplus) || defined(_MSC_EXTENSIONS) #define and && Do not pass /Za to MSVC to generate moc_predefs.h, because this option is incompatible with compiler options like /fp:fast that may be user-specified. This reverts commit e1a70ce4 and re-fixes the issue similarly to commit d72ac3f3. Task-number: QTBUG-58391 Change-Id: I5c0143283afed09f98200806c87259c039c00ae1 Reviewed-by: Friedemann Kleint Reviewed-by: Oswald Buddenhagen Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/tools/moc/main.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/tools') diff --git a/src/tools/moc/main.cpp b/src/tools/moc/main.cpp index b30de66258..25f2fd45bf 100644 --- a/src/tools/moc/main.cpp +++ b/src/tools/moc/main.cpp @@ -380,6 +380,9 @@ int runMoc(int argc, char **argv) error("Missing macro name"); parser.showHelp(1); } + // Prevent parse errors on MSVC extensions. + if (name == "_MSC_EXTENSIONS") + continue; Macro macro; macro.symbols = Preprocessor::tokenize(value, 1, Preprocessor::TokenizeDefine); macro.symbols.removeLast(); // remove the EOF symbol -- cgit v1.2.3