diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2025-12-31 14:13:21 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2026-01-01 02:07:29 +0000 |
| commit | 55367bfa224d3f85d4cbd55b83f63ed6026b7b7c (patch) | |
| tree | 47df176ae733eb2ccaed0862f625076114c51d26 | |
| parent | 964790664408cb22fef01b255a76615833bf0ce7 (diff) | |
| -rw-r--r-- | devel/boost-libs/files/patch-boost_type__traits_is__signed.hpp | 48 | ||||
| -rw-r--r-- | devel/boost-libs/files/patch-boost_type__traits_is__unsigned.hpp | 42 |
2 files changed, 90 insertions, 0 deletions
diff --git a/devel/boost-libs/files/patch-boost_type__traits_is__signed.hpp b/devel/boost-libs/files/patch-boost_type__traits_is__signed.hpp new file mode 100644 index 000000000000..0ffb4d40bb46 --- /dev/null +++ b/devel/boost-libs/files/patch-boost_type__traits_is__signed.hpp @@ -0,0 +1,48 @@ +--- boost/type_traits/is_signed.hpp.orig 2025-08-06 18:49:14 UTC ++++ boost/type_traits/is_signed.hpp +@@ -13,6 +13,7 @@ + #include <boost/type_traits/is_integral.hpp> + #include <boost/type_traits/remove_cv.hpp> + #include <boost/type_traits/is_enum.hpp> ++#include <boost/core/underlying_type.hpp> + #include <climits> + + namespace boost { +@@ -25,6 +26,18 @@ namespace detail{ + + namespace detail{ + ++template <class no_cv_t, bool is_enum> ++struct is_signed_values_underlying_type ++{ ++ typedef no_cv_t underlying_type; ++}; ++ ++template <class no_cv_t> ++struct is_signed_values_underlying_type<no_cv_t, true> ++{ ++ typedef typename ::boost::underlying_type<no_cv_t>::type underlying_type; ++}; ++ + template <class T> + struct is_signed_values + { +@@ -34,14 +47,15 @@ struct is_signed_values + // the correct answer. + // + typedef typename remove_cv<T>::type no_cv_t; +- static const no_cv_t minus_one = (static_cast<no_cv_t>(-1)); +- static const no_cv_t zero = (static_cast<no_cv_t>(0)); ++ typedef typename is_signed_values_underlying_type<no_cv_t, ::boost::is_enum<T>::value>::underlying_type underlying_type; ++ ++ static const underlying_type minus_one = (static_cast<underlying_type>(-1)); ++ static const underlying_type zero = (static_cast<underlying_type>(0)); + }; + + template <class T> + struct is_signed_helper + { +- typedef typename remove_cv<T>::type no_cv_t; + BOOST_STATIC_CONSTANT(bool, value = (!(::boost::detail::is_signed_values<T>::minus_one > boost::detail::is_signed_values<T>::zero))); + }; + diff --git a/devel/boost-libs/files/patch-boost_type__traits_is__unsigned.hpp b/devel/boost-libs/files/patch-boost_type__traits_is__unsigned.hpp new file mode 100644 index 000000000000..0a776dd4790f --- /dev/null +++ b/devel/boost-libs/files/patch-boost_type__traits_is__unsigned.hpp @@ -0,0 +1,42 @@ +--- boost/type_traits/is_unsigned.hpp.orig 2025-08-06 18:49:14 UTC ++++ boost/type_traits/is_unsigned.hpp +@@ -13,6 +13,7 @@ + #include <boost/type_traits/is_integral.hpp> + #include <boost/type_traits/is_enum.hpp> + #include <boost/type_traits/remove_cv.hpp> ++#include <boost/core/underlying_type.hpp> + + #include <climits> + +@@ -26,6 +27,18 @@ namespace detail{ + + namespace detail{ + ++template <class no_cv_t, bool is_enum> ++struct is_unsigned_values_underlying_type ++{ ++ typedef no_cv_t underlying_type; ++}; ++ ++template <class no_cv_t> ++struct is_unsigned_values_underlying_type<no_cv_t, true> ++{ ++ typedef typename ::boost::underlying_type<no_cv_t>::type underlying_type; ++}; ++ + template <class T> + struct is_unsigned_values + { +@@ -35,8 +48,10 @@ struct is_unsigned_values + // the correct answer. + // + typedef typename remove_cv<T>::type no_cv_t; +- static const no_cv_t minus_one = (static_cast<no_cv_t>(-1)); +- static const no_cv_t zero = (static_cast<no_cv_t>(0)); ++ typedef typename is_unsigned_values_underlying_type<no_cv_t, ::boost::is_enum<T>::value>::underlying_type underlying_type; ++ ++ static const underlying_type minus_one = (static_cast<underlying_type>(-1)); ++ static const underlying_type zero = (static_cast<underlying_type>(0)); + }; + + template <class T> |
