From c32ef0a725c7ac9d8a9ab053407389ef2fddc64e Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 5 Jul 2016 11:06:55 +0200 Subject: Don't error out on preprocessor concatenation of two strings "foo" ## "bar" doesn't make a lot of sense, but MSVC allows them (although gcc errors out on them). Simply ignore the ## in this case instead of aborting with an error. Fixes parsing of the Windows winsock2.h header. Task-number: QTBUG-54560 Change-Id: I84cd5fbb56a006cf379430708c955cf0da475cff Reviewed-by: Olivier Goffart (Woboq GmbH) Reviewed-by: Edward Welbourne --- tests/auto/tools/moc/tst_moc.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/auto/tools/moc') diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp index 2989ac4485..9fdd37ea9b 100644 --- a/tests/auto/tools/moc/tst_moc.cpp +++ b/tests/auto/tools/moc/tst_moc.cpp @@ -70,6 +70,12 @@ #include "non-gadget-parent-class.h" #include "grand-parent-gadget-class.h" +#ifdef Q_MOC_RUN +// check that moc can parse these constructs, they are being used in Windows winsock2.h header +#define STRING_HASH_HASH(x) ("foo" ## x ## "bar") +const char *string_hash_hash = STRING_HASH_HASH("baz"); +#endif + Q_DECLARE_METATYPE(const QMetaObject*); -- cgit v1.2.3