path: root/src/tools
diff options
authorJoerg Bornemann <>2017-05-23 11:07:11 +0200
committerJoerg Bornemann <>2017-05-30 15:34:26 +0000
commitc3030d7163245b55abfd09eefe696c035c55011c (patch)
tree300e5f0a9bfc9f9d398afb8dd065b620dd143b01 /src/tools
parentc25ad981a334a4a720ae48cfe800868c4aef51a9 (diff)
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) <>
Diffstat (limited to 'src/tools')
1 files changed, 3 insertions, 0 deletions
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");
+ // 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