From 715389d35db1df6179fb6005431876422b402728 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 16 Mar 2019 12:02:00 +0200 Subject: [PATCH] Use Qt's Q_DECL_UNUSED instead of internal V_UNUSED. --HG-- branch : develop --- src/libs/vmisc/qt_dispatch/qt_dispatch.h | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/libs/vmisc/qt_dispatch/qt_dispatch.h b/src/libs/vmisc/qt_dispatch/qt_dispatch.h index 04aa1d684..aa3e9dcda 100644 --- a/src/libs/vmisc/qt_dispatch/qt_dispatch.h +++ b/src/libs/vmisc/qt_dispatch/qt_dispatch.h @@ -17,12 +17,6 @@ #include "logging.h" -#ifdef __GNUC__ -#define V_UNUSED __attribute__ ((unused)) -#else -#define V_UNUSED -#endif - typedef std::function voidBlock; class WorkerClass : public QObject @@ -43,7 +37,7 @@ public slots: } }; -static inline void q_dispatch_async(QThread* thread, voidBlock block) V_UNUSED; +static inline Q_DECL_UNUSED void q_dispatch_async(QThread* thread, voidBlock block); static inline void q_dispatch_async(QThread* thread, voidBlock block) { qRegisterMetaType("voidBlock"); @@ -52,7 +46,7 @@ static inline void q_dispatch_async(QThread* thread, voidBlock block) QMetaObject::invokeMethod(worker, "DoWork", Qt::QueuedConnection, Q_ARG(voidBlock, block)); } -static inline void q_dispatch_async_main(voidBlock block) V_UNUSED; +static inline Q_DECL_UNUSED void q_dispatch_async_main(voidBlock block); static inline void q_dispatch_async_main(voidBlock block) { QThread *mainThread = QCoreApplication::instance()->thread(); @@ -98,8 +92,8 @@ private: QString m_category; }; -static inline void q_dispatch_async(QThread* thread, msgHandlerBlock block, QtMsgType type, - const QMessageLogContext &context, const QString &msg) V_UNUSED; +static inline Q_DECL_UNUSED void q_dispatch_async(QThread* thread, msgHandlerBlock block, QtMsgType type, + const QMessageLogContext &context, const QString &msg); static inline void q_dispatch_async(QThread* thread, msgHandlerBlock block, QtMsgType type, const QMessageLogContext &context, const QString &msg) { @@ -109,8 +103,8 @@ static inline void q_dispatch_async(QThread* thread, msgHandlerBlock block, QtMs QMetaObject::invokeMethod(worker, "DoWork", Qt::QueuedConnection, Q_ARG(msgHandlerBlock, block)); } -static inline void q_dispatch_async_main(msgHandlerBlock block, QtMsgType type, const QMessageLogContext &context, - const QString &msg) V_UNUSED; +static inline Q_DECL_UNUSED void q_dispatch_async_main(msgHandlerBlock block, QtMsgType type, + const QMessageLogContext &context, const QString &msg); static inline void q_dispatch_async_main(msgHandlerBlock block, QtMsgType type, const QMessageLogContext &context, const QString &msg) {