From b7c025a5dd6c3b2b84341f52920c2cc6ceda3295 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Wed, 24 Jun 2015 09:43:09 +0200 Subject: [PATCH] Clang: Respect QT_NO_*KEYWORDS in qt5-qobjectdefs-injected.h Change-Id: I299db813c13f273a40e447c5fdde8ff8757480ba Reviewed-by: Marco Bubke --- .../cplusplus/qt5-qobjectdefs-injected.h | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/share/qtcreator/cplusplus/qt5-qobjectdefs-injected.h b/share/qtcreator/cplusplus/qt5-qobjectdefs-injected.h index 22f6f0ca2f..946ec33bd1 100644 --- a/share/qtcreator/cplusplus/qt5-qobjectdefs-injected.h +++ b/share/qtcreator/cplusplus/qt5-qobjectdefs-injected.h @@ -30,16 +30,24 @@ #define QT_NO_META_MACROS -#define signals public __attribute__((annotate("qt_signal"))) -#define slots __attribute__((annotate("qt_slot"))) -#define Q_SIGNALS signals -#define Q_SLOTS slots +#if defined(QT_NO_KEYWORDS) +# define QT_NO_EMIT +#else +# ifndef QT_NO_SIGNALS_SLOTS_KEYWORDS +# define signals public __attribute__((annotate("qt_signal"))) +# define slots __attribute__((annotate("qt_slot"))) +# endif +#endif +#define Q_SIGNALS public __attribute__((annotate("qt_signal"))) +#define Q_SLOTS slots __attribute__((annotate("qt_slot"))) #define Q_SIGNAL __attribute__((annotate("qt_signal"))) #define Q_SLOT __attribute__((annotate("qt_slot"))) -# define Q_PRIVATE_SLOT(d, signature) +#define Q_PRIVATE_SLOT(d, signature) #define Q_EMIT -#define emit +#ifndef QT_NO_EMIT +# define emit +#endif #define Q_CLASSINFO(name, value) #define Q_PLUGIN_METADATA(x) #define Q_INTERFACES(x) -- GitLab