From 88a7be42b5b492f42c25a22e5a28c84950e32db4 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 14 Jun 2021 14:38:26 +0300 Subject: [PATCH] Update Clang version check --- include/boost/system/detail/config.hpp | 6 ++++++ include/boost/system/detail/error_code.hpp | 2 +- test/std_interop_test2.cpp | 10 +++++----- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/include/boost/system/detail/config.hpp b/include/boost/system/detail/config.hpp index f6c7062..1855aa1 100644 --- a/include/boost/system/detail/config.hpp +++ b/include/boost/system/detail/config.hpp @@ -56,4 +56,10 @@ # define BOOST_SYSTEM_DEPRECATED(msg) #endif +// BOOST_SYSTEM_CLANG_6 + +#if defined(__clang__) && (__clang_major__ < 7 || (defined(__APPLE__) && __clang_major__ < 11)) +# define BOOST_SYSTEM_CLANG_6 +#endif + #endif // BOOST_SYSTEM_DETAIL_CONFIG_HPP_INCLUDED diff --git a/include/boost/system/detail/error_code.hpp b/include/boost/system/detail/error_code.hpp index 04b4364..f9b5854 100644 --- a/include/boost/system/detail/error_code.hpp +++ b/include/boost/system/detail/error_code.hpp @@ -402,7 +402,7 @@ public: return *reinterpret_cast( d2_ ); } -#if defined(__clang__) && __clang_major__ < 7 +#if defined(BOOST_SYSTEM_CLANG_6) template::value>::type> diff --git a/test/std_interop_test2.cpp b/test/std_interop_test2.cpp index c019c87..17f0ee7 100644 --- a/test/std_interop_test2.cpp +++ b/test/std_interop_test2.cpp @@ -37,7 +37,7 @@ int main() boost::system::error_code e2( e1 ); f1( e1, e1.value(), e1.category() ); -#if !(defined(__clang__) && __clang_major__ < 7) +#if !defined(BOOST_SYSTEM_CLANG_6) f2( e1, e1.value(), e1.category() ); #endif @@ -49,7 +49,7 @@ int main() boost::system::error_code e2( e1 ); f1( e1, e1.value(), e1.category() ); -#if !(defined(__clang__) && __clang_major__ < 7) +#if !defined(BOOST_SYSTEM_CLANG_6) f2( e1, e1.value(), e1.category() ); #endif @@ -61,7 +61,7 @@ int main() boost::system::error_code e2( e1 ); f1( e1, e1.value(), e1.category() ); -#if !(defined(__clang__) && __clang_major__ < 7) +#if !defined(BOOST_SYSTEM_CLANG_6) f2( e1, e1.value(), e1.category() ); #endif @@ -73,7 +73,7 @@ int main() boost::system::error_code e2( e1 ); f1( e1, e1.value(), e1.category() ); -#if !(defined(__clang__) && __clang_major__ < 7) +#if !defined(BOOST_SYSTEM_CLANG_6) f2( e1, e1.value(), e1.category() ); #endif @@ -85,7 +85,7 @@ int main() boost::system::error_code e2( e1 ); f1( e1, e1.value(), e1.category() ); -#if !(defined(__clang__) && __clang_major__ < 7) +#if !defined(BOOST_SYSTEM_CLANG_6) f2( e1, e1.value(), e1.category() ); #endif