mdbx++: disable C++20 concepts for stupid AppleClang 13.x (hotfix).

This commit is contained in:
Leonid Yuriev 2021-12-08 05:10:47 +03:00
parent df6b9028ec
commit 739e02655e
2 changed files with 13 additions and 3 deletions

View File

@ -24,6 +24,10 @@ Acknowledgements:
- [gcxfd <i@rmw.link>](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()`.

View File

@ -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<TYPE>)
#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 <typename T>
concept MutableByteProducer = requires(T a, char array[42]) {