aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/events/encryptionevent.h3
-rw-r--r--lib/events/roommemberevent.h2
-rw-r--r--lib/quotient_common.h7
3 files changed, 10 insertions, 2 deletions
diff --git a/lib/events/encryptionevent.h b/lib/events/encryptionevent.h
index 56913393..124ced33 100644
--- a/lib/events/encryptionevent.h
+++ b/lib/events/encryptionevent.h
@@ -6,13 +6,14 @@
#include "eventcontent.h"
#include "stateevent.h"
+#include "quotient_common.h"
namespace Quotient {
class QUOTIENT_API EncryptionEventContent : public EventContent::Base {
public:
enum EncryptionType : size_t { MegolmV1AesSha2 = 0, Undefined };
- explicit(false) EncryptionEventContent(EncryptionType et);
+ QUO_IMPLICIT EncryptionEventContent(EncryptionType et);
[[deprecated("This constructor will require explicit EncryptionType soon")]] //
explicit EncryptionEventContent()
: EncryptionEventContent(Undefined)
diff --git a/lib/events/roommemberevent.h b/lib/events/roommemberevent.h
index 3296ae22..ceb7826b 100644
--- a/lib/events/roommemberevent.h
+++ b/lib/events/roommemberevent.h
@@ -15,7 +15,7 @@ public:
using MembershipType
[[deprecated("Use Quotient::Membership instead")]] = Membership;
- explicit(false) MemberEventContent(Membership ms) : membership(ms) {}
+ QUO_IMPLICIT MemberEventContent(Membership ms) : membership(ms) {}
explicit MemberEventContent(const QJsonObject& json);
Membership membership;
diff --git a/lib/quotient_common.h b/lib/quotient_common.h
index 02a9f0cd..b3fb3efa 100644
--- a/lib/quotient_common.h
+++ b/lib/quotient_common.h
@@ -25,6 +25,13 @@
Q_ENUM_NS_IMPL(Enum) \
Q_FLAG_NS(Flags)
+// Apple Clang hasn't caught up with explicit(bool) yet
+#if __cpp_conditional_explicit >= 201806L
+#define QUO_IMPLICIT explicit(false)
+#else
+#define QUO_IMPLICIT
+#endif
+
#define DECL_DEPRECATED_ENUMERATOR(Deprecated, Recommended) \
Deprecated Q_DECL_ENUMERATOR_DEPRECATED_X("Use " #Recommended) = Recommended