From 88834ea75ee3304f8ab773e05aa64ce84643f236 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Wed, 11 Jul 2018 18:24:04 +0900 Subject: 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. --- lib/events/event.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/events') 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 +#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<>() === -- cgit v1.2.3