From d98b351eef60f468dceafa544337f04f442a5628 Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Mon, 6 Jan 2025 19:23:09 -0500 Subject: [PATCH] let us be more careful with concepts, we require __cpp_concepts >= 201907L and check for old versions of Apple clang (#2321) * let us be more careful with concepts, we require __cpp_concepts >= 202002L * checking Apple version * let us be more specific * removing extra endif --- include/simdjson/compiler_check.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/simdjson/compiler_check.h b/include/simdjson/compiler_check.h index b306ab324..98b586561 100644 --- a/include/simdjson/compiler_check.h +++ b/include/simdjson/compiler_check.h @@ -56,9 +56,20 @@ #endif #endif +#if defined(__apple_build_version__) +#if __apple_build_version__ < 14000000 +#define SIMDJSON_CONCEPT_DISABLED 1 // apple-clang/13 doesn't support std::convertible_to +#endif +#endif + + #if defined(__cpp_concepts) && !defined(SIMDJSON_CONCEPT_DISABLED) +#if __cpp_concepts >= 201907L #include #define SIMDJSON_SUPPORTS_DESERIALIZATION 1 +#else +#define SIMDJSON_SUPPORTS_DESERIALIZATION 0 +#endif #else // defined(__cpp_concepts) && !defined(SIMDJSON_CONCEPT_DISABLED) #define SIMDJSON_SUPPORTS_DESERIALIZATION 0 #endif // defined(__cpp_concepts) && !defined(SIMDJSON_CONCEPT_DISABLED)