From eb2a73a3a6ad3f3bf587b460ebc76d853c4d6317 Mon Sep 17 00:00:00 2001 From: Artalus Date: Fri, 16 Aug 2024 15:54:01 +0400 Subject: [PATCH] boost: Fix compilation errors with newer Clang --- recipes/boost/all/conandata.yml | 28 ++++++ .../boost_build-with-newer-clang.patch | 89 +++++++++++++++++++ 2 files changed, 117 insertions(+) create mode 100644 recipes/boost/all/patches/boost_build-with-newer-clang.patch diff --git a/recipes/boost/all/conandata.yml b/recipes/boost/all/conandata.yml index 9a49b404141c2..b6c23a1e460dc 100644 --- a/recipes/boost/all/conandata.yml +++ b/recipes/boost/all/conandata.yml @@ -148,6 +148,10 @@ patches: patch_description: "Fix MSVC /RTCc build runtime failures." patch_type: "official" patch_source: "https://www.boost.org/patches/1_80_0/0006-unordered-msvc-rtcc.patch" + - patch_file: "patches/boost_build-with-newer-clang.patch" + patch_description: "Fix MPL/Numeric compilation errors with newer Clang" + patch_type: "portability" + patch_source: "https://github.com/boostorg/numeric_conversion/commit/50a1eae942effb0a9b90724323ef8f2a67e7984a , https://github.com/boostorg/mpl/pull/77" "1.79.0": - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" patch_description: "Fails the build when there is no iconv backend" @@ -172,6 +176,10 @@ patches: patch_description: "Fix access specifier preventing use of experimental iterators. Allow more granular control over enabled experimental features." patch_type: "portability" patch_source: "https://github.com/boostorg/geometry/discussions/1041" + - patch_file: "patches/boost_build-with-newer-clang.patch" + patch_description: "Fix MPL/Numeric compilation errors with newer Clang" + patch_type: "portability" + patch_source: "https://github.com/boostorg/numeric_conversion/commit/50a1eae942effb0a9b90724323ef8f2a67e7984a , https://github.com/boostorg/mpl/pull/77" "1.78.0": - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" patch_description: "Fails the build when there is no iconv backend" @@ -192,6 +200,10 @@ patches: patch_description: "Don't skip install targets if there's no in ureqs" patch_type: "official" patch_source: "https://github.com/boostorg/build/pull/113" + - patch_file: "patches/boost_build-with-newer-clang.patch" + patch_description: "Fix MPL/Numeric compilation errors with newer Clang" + patch_type: "portability" + patch_source: "https://github.com/boostorg/numeric_conversion/commit/50a1eae942effb0a9b90724323ef8f2a67e7984a , https://github.com/boostorg/mpl/pull/77" "1.77.0": - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" patch_description: "Fails the build when there is no iconv backend" @@ -211,6 +223,10 @@ patches: - patch_file: "patches/1.77.0-boost_build-with-newer-b2.patch" patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')" patch_type: "conan" + - patch_file: "patches/boost_build-with-newer-clang.patch" + patch_description: "Fix MPL/Numeric compilation errors with newer Clang" + patch_type: "portability" + patch_source: "https://github.com/boostorg/numeric_conversion/commit/50a1eae942effb0a9b90724323ef8f2a67e7984a , https://github.com/boostorg/mpl/pull/77" "1.76.0": - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" patch_description: "Fails the build when there is no iconv backend" @@ -231,6 +247,10 @@ patches: - patch_file: "patches/1.77.0-boost_build-with-newer-b2.patch" patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')" patch_type: "conan" + - patch_file: "patches/boost_build-with-newer-clang.patch" + patch_description: "Fix MPL/Numeric compilation errors with newer Clang" + patch_type: "portability" + patch_source: "https://github.com/boostorg/numeric_conversion/commit/50a1eae942effb0a9b90724323ef8f2a67e7984a , https://github.com/boostorg/mpl/pull/77" "1.75.0": - patch_file: "patches/boost_build_qcc_fix_debug_build_parameter_since_1_74.patch" patch_description: "" @@ -253,6 +273,10 @@ patches: - patch_file: "patches/1.75.0-boost_build-with-newer-b2.patch" patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')" patch_type: "conan" + - patch_file: "patches/boost_build-with-newer-clang.patch" + patch_description: "Fix MPL/Numeric compilation errors with newer Clang" + patch_type: "portability" + patch_source: "https://github.com/boostorg/numeric_conversion/commit/50a1eae942effb0a9b90724323ef8f2a67e7984a , https://github.com/boostorg/mpl/pull/77" "1.74.0": - patch_file: "patches/boost_build_qcc_fix_debug_build_parameter_since_1_74.patch" patch_description: "" @@ -278,6 +302,10 @@ patches: - patch_file: "patches/1.75.0-boost_build-with-newer-b2.patch" patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')" patch_type: "conan" + - patch_file: "patches/boost_build-with-newer-clang.patch" + patch_description: "Fix MPL/Numeric compilation errors with newer Clang" + patch_type: "portability" + patch_source: "https://github.com/boostorg/numeric_conversion/commit/50a1eae942effb0a9b90724323ef8f2a67e7984a , https://github.com/boostorg/mpl/pull/77" "1.73.0": - patch_file: "patches/boost_build_qcc_fix_debug_build_parameter.patch" patch_description: "" diff --git a/recipes/boost/all/patches/boost_build-with-newer-clang.patch b/recipes/boost/all/patches/boost_build-with-newer-clang.patch new file mode 100644 index 0000000000000..585f877ae2552 --- /dev/null +++ b/recipes/boost/all/patches/boost_build-with-newer-clang.patch @@ -0,0 +1,89 @@ +diff --git a/boost/numeric/conversion/detail/int_float_mixture.hpp b/boost/numeric/conversion/detail/int_float_mixture.hpp +index 464e527..7690d07 100644 +--- a/boost/numeric/conversion/detail/int_float_mixture.hpp ++++ b/boost/numeric/conversion/detail/int_float_mixture.hpp +@@ -16,15 +16,15 @@ + #include "boost/numeric/conversion/int_float_mixture_enum.hpp" + #include "boost/numeric/conversion/detail/meta.hpp" + +-#include "boost/mpl/integral_c.hpp" ++#include "boost/type_traits/integral_constant.hpp" + + namespace boost { namespace numeric { namespace convdetail + { + // Integral Constants for 'IntFloatMixture' +- typedef mpl::integral_c int2int_c ; +- typedef mpl::integral_c int2float_c ; +- typedef mpl::integral_c float2int_c ; +- typedef mpl::integral_c float2float_c ; ++ typedef boost::integral_constant int2int_c ; ++ typedef boost::integral_constant int2float_c ; ++ typedef boost::integral_constant float2int_c ; ++ typedef boost::integral_constant float2float_c ; + + // Metafunction: + // +diff --git a/boost/numeric/conversion/detail/sign_mixture.hpp b/boost/numeric/conversion/detail/sign_mixture.hpp +index c7f9e42..fde1584 100644 +--- a/boost/numeric/conversion/detail/sign_mixture.hpp ++++ b/boost/numeric/conversion/detail/sign_mixture.hpp +@@ -16,15 +16,15 @@ + #include "boost/numeric/conversion/sign_mixture_enum.hpp" + #include "boost/numeric/conversion/detail/meta.hpp" + +-#include "boost/mpl/integral_c.hpp" ++#include "boost/type_traits/integral_constant.hpp" + + namespace boost { namespace numeric { namespace convdetail + { + // Integral Constants for 'SignMixture' +- typedef mpl::integral_c unsig2unsig_c ; +- typedef mpl::integral_c sig2sig_c ; +- typedef mpl::integral_c sig2unsig_c ; +- typedef mpl::integral_c unsig2sig_c ; ++ typedef boost::integral_constant unsig2unsig_c ; ++ typedef boost::integral_constant sig2sig_c ; ++ typedef boost::integral_constant sig2unsig_c ; ++ typedef boost::integral_constant unsig2sig_c ; + + // Metafunction: + // +diff --git a/boost/numeric/conversion/detail/udt_builtin_mixture.hpp b/boost/numeric/conversion/detail/udt_builtin_mixture.hpp +index 36dbc49..a39d29f 100644 +--- a/boost/numeric/conversion/detail/udt_builtin_mixture.hpp ++++ b/boost/numeric/conversion/detail/udt_builtin_mixture.hpp +@@ -15,15 +15,15 @@ + #include "boost/numeric/conversion/udt_builtin_mixture_enum.hpp" + #include "boost/numeric/conversion/detail/meta.hpp" + +-#include "boost/mpl/integral_c.hpp" ++#include "boost/type_traits/integral_constant.hpp" + + namespace boost { namespace numeric { namespace convdetail + { + // Integral Constants for 'UdtMixture' +- typedef mpl::integral_c builtin2builtin_c ; +- typedef mpl::integral_c builtin2udt_c ; +- typedef mpl::integral_c udt2builtin_c ; +- typedef mpl::integral_c udt2udt_c ; ++ typedef boost::integral_constant builtin2builtin_c ; ++ typedef boost::integral_constant builtin2udt_c ; ++ typedef boost::integral_constant udt2builtin_c ; ++ typedef boost::integral_constant udt2udt_c ; + + // Metafunction: + // +diff --git a/boost/mpl/aux_/integral_wrapper.hpp b/boost/mpl/aux_/integral_wrapper.hpp +index 8748fbb93..5f24b7949 100644 +--- a/boost/mpl/aux_/integral_wrapper.hpp ++++ b/boost/mpl/aux_/integral_wrapper.hpp +@@ -56,7 +56,8 @@ struct AUX_WRAPPER_NAME + // have to #ifdef here: some compilers don't like the 'N + 1' form (MSVC), + // while some other don't like 'value + 1' (Borland), and some don't like + // either +-#if BOOST_WORKAROUND(__EDG_VERSION__, <= 243) ++#if BOOST_WORKAROUND(__EDG_VERSION__, <= 243) \ ++ || __cplusplus >= 201103L + private: + BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, next_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1))); + BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, prior_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1)));