aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-01-28 17:08:10 +0100
committerAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-01-28 17:08:10 +0100
commit1747575321cda4fc11f90c2ffb2148a69d0d9946 (patch)
tree6acd5b8ed227d0cf96c5345e53bc15ecd7fcc7fc
parent08612cb253417fe70ef45a1ad08663a0745d748a (diff)
downloadlibquotient-1747575321cda4fc11f90c2ffb2148a69d0d9946.tar.gz
libquotient-1747575321cda4fc11f90c2ffb2148a69d0d9946.zip
QUO_IMPLICIT
Because Apple Clang choked on `explicit(false)`.
-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