From 739e02655edf8686695b2ea84a81da101af0d016 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Wed, 8 Dec 2021 05:10:47 +0300 Subject: [PATCH] mdbx++: disable C++20 concepts for stupid AppleClang 13.x (hotfix). --- ChangeLog.md | 4 ++++ mdbx.h++ | 12 +++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index f52fdd44..3dbf003d 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -24,6 +24,10 @@ Acknowledgements: - [gcxfd ](https://github.com/gcxfd) for reporting, contributing and testing. +Fixes: + + - Disabled C++20 concepts for stupid AppleClang 13.x + Minors: - Fixed returning `MDBX_RESULT_TRUE` (-1) from `mdbx_env_set_option()`. diff --git a/mdbx.h++ b/mdbx.h++ index f0d689c6..d94370a2 100644 --- a/mdbx.h++ +++ b/mdbx.h++ @@ -194,7 +194,9 @@ #ifndef MDBX_CXX20_CONCEPT #if defined(DOXYGEN) || \ (defined(__cpp_concepts) && __cpp_concepts >= 201907L && \ - (!defined(__clang__) || __clang_major__ >= 12)) + (!defined(__clang__) || (__clang_major__ >= 12 && !defined(__APPLE__)) || \ + __clang_major__ >= \ + /* Hope Apple will fix concepts in AppleClang 14 */ 14)) #define MDBX_CXX20_CONCEPT(CONCEPT, NAME) CONCEPT NAME #else #define MDBX_CXX20_CONCEPT(CONCEPT, NAME) typename NAME @@ -204,7 +206,9 @@ #ifndef MDBX_ASSERT_CXX20_CONCEPT_SATISFIED #if defined(DOXYGEN) || \ (defined(__cpp_concepts) && __cpp_concepts >= 201907L && \ - (!defined(__clang__) || __clang_major__ >= 12)) + (!defined(__clang__) || (__clang_major__ >= 12 && !defined(__APPLE__)) || \ + __clang_major__ >= \ + /* Hope Apple will fix concepts in AppleClang 14 */ 14)) #define MDBX_ASSERT_CXX20_CONCEPT_SATISFIED(CONCEPT, TYPE) \ static_assert(CONCEPT) #else @@ -473,7 +477,9 @@ static MDBX_CXX20_CONSTEXPR void *memcpy(void *dest, const void *src, #if defined(DOXYGEN) || \ (defined(__cpp_concepts) && __cpp_concepts >= 201907L && \ - (!defined(__clang__) || __clang_major__ >= 12)) + (!defined(__clang__) || (__clang_major__ >= 12 && !defined(__APPLE__)) || \ + __clang_major__ >= \ + /* Hope Apple will fix concepts in AppleClang 14 */ 14)) template concept MutableByteProducer = requires(T a, char array[42]) {