From 72d6717b268e66e3ba8d222deb74513337368a60 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 23 Sep 2013 21:28:54 +0200 Subject: moc: Don't stumble over MSVC __declspec. Commit 310031188c6 (Fix moc stumbling over gcc __attribute__ extensions, 2012-10-01) applied similar logic for GNU style attributes. Change-Id: I550eaefd703b4e974e6ffae7716f02074c8a8823 Reviewed-by: Olivier Goffart --- tests/auto/tools/moc/function-with-attributes.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'tests') 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() {} }; -- cgit v1.2.3