aboutsummaryrefslogtreecommitdiff
path: root/lib/events
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-07-11 18:24:04 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-07-11 18:24:04 +0900
commit88834ea75ee3304f8ab773e05aa64ce84643f236 (patch)
treec9f5f441e530a3d52b9637ceff2d195043e4f0cf /lib/events
parent1ffb27f506ed1a4b3766768b872a86af7799a39e (diff)
downloadlibquotient-88834ea75ee3304f8ab773e05aa64ce84643f236.tar.gz
libquotient-88834ea75ee3304f8ab773e05aa64ce84643f236.zip
Introduce DISABLE_EVENTTYPE flag
If defined (value doesn't matter), it will suppress generation of deprecated EventType constants. Not defined by default, as of 0.4.
Diffstat (limited to 'lib/events')
-rw-r--r--lib/events/event.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/events/event.h b/lib/events/event.h
index 8eb4ee88..8757ba53 100644
--- a/lib/events/event.h
+++ b/lib/events/event.h
@@ -23,6 +23,10 @@
#include <QtCore/QJsonObject>
+#ifndef DISABLE_EVENTTYPE
+#define USE_EVENTTYPE 1
+#endif
+
namespace QMatrixClient
{
// === event_ptr_tt<> and type casting facilities ===
@@ -276,6 +280,7 @@ namespace QMatrixClient
} \
// End of macro
+#ifdef USE_EVENTTYPE
namespace EventType
{
inline event_type_t logEventType(event_type_t id, const char* idName)
@@ -294,6 +299,9 @@ namespace QMatrixClient
static const auto _Id = logEventType(typeId<_Type>(), #_Id); \
} \
// End of macro
+#else
+#define DEFINE_EVENTTYPE_ALIAS(_Id, _Type) // Nothing
+#endif
// === is<>(), eventCast<>() and visit<>() ===