summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/tools/moc/main.cpp1
-rw-r--r--tests/auto/tools/moc/function-with-attributes.h13
2 files changed, 11 insertions, 3 deletions
diff --git a/src/tools/moc/main.cpp b/src/tools/moc/main.cpp
index 98472792f8..3ae6445093 100644
--- a/src/tools/moc/main.cpp
+++ b/src/tools/moc/main.cpp
@@ -199,6 +199,7 @@ int runMoc(int argc, char **argv)
dummyVariadicFunctionMacro.isVariadic = true;
dummyVariadicFunctionMacro.arguments += Symbol(0, PP_IDENTIFIER, "__VA_ARGS__");
pp.macros["__attribute__"] = dummyVariadicFunctionMacro;
+ pp.macros["__declspec"] = dummyVariadicFunctionMacro;
QString filename;
QString output;
diff --git a/tests/auto/tools/moc/function-with-attributes.h b/tests/auto/tools/moc/function-with-attributes.h
index 21a7405af7..afa02e6f3a 100644
--- a/tests/auto/tools/moc/function-with-attributes.h
+++ b/tests/auto/tools/moc/function-with-attributes.h
@@ -43,15 +43,22 @@
// test support for gcc attributes with functions
#if defined(Q_CC_GNU) || defined(Q_MOC_RUN)
-#define DEPRECATED __attribute__ ((__deprecated__))
+#define DEPRECATED1 __attribute__ ((__deprecated__))
#else
-#define DEPRECATED
+#define DEPRECATED1
+#endif
+
+#if defined(Q_CC_MSVC) || defined(Q_MOC_RUN)
+#define DEPRECATED2 __declspec(deprecated)
+#else
+#define DEPRECATED2
#endif
class FunctionWithAttributes : public QObject
{
Q_OBJECT
public slots:
- DEPRECATED void test() {}
+ DEPRECATED1 void test1() {}
+ DEPRECATED2 void test2() {}
};