From ba6c3788978b1f7044568c5737bd60d0018ab5e5 Mon Sep 17 00:00:00 2001 From: Frank Dischner Date: Wed, 26 Jan 2022 18:16:05 -0600 Subject: [PATCH] refactor: use libc++ version to determine range-v3 use Allows using AppleClang where __clang_major__ does not match the llvm/libc++ version. --- src/core/include/units/bits/external/hacks.h | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/core/include/units/bits/external/hacks.h b/src/core/include/units/bits/external/hacks.h index 1db8e7de..3826ae44 100644 --- a/src/core/include/units/bits/external/hacks.h +++ b/src/core/include/units/bits/external/hacks.h @@ -63,18 +63,13 @@ #define UNITS_DIAGNOSTIC_IGNORE_UNREACHABLE UNITS_DIAGNOSTIC_IGNORE(4702) #endif -#if UNITS_COMP_CLANG - -#include #if _LIBCPP_VERSION #define UNITS_LIBCXX _LIBCPP_VERSION #endif -#endif - #if UNITS_LIBCXX -#if UNITS_COMP_CLANG == 12 +#if UNITS_LIBCXX < 13000 #include #include @@ -84,7 +79,7 @@ #include #include -#elif UNITS_COMP_CLANG == 13 +#elif UNITS_LIBCXX < 14000 #include @@ -115,7 +110,7 @@ concept default_constructible = constructible_from; #elif UNITS_LIBCXX -#if UNITS_COMP_CLANG == 12 +#if UNITS_LIBCXX < 13000 // concepts using concepts::common_with; @@ -228,7 +223,7 @@ constexpr bool in_range(T t) noexcept std::cmp_less_equal(t, std::numeric_limits::max()); } -#elif UNITS_COMP_CLANG == 13 +#elif UNITS_LIBCXX < 14000 using concepts::three_way_comparable; using concepts::three_way_comparable_with;