Add patch for Boost.Multiprecision (#1349638)

This commit is contained in:
Jonathan Wakely 2016-06-28 17:10:00 +01:00
parent 8c05e809d0
commit ca4b80e4c6
2 changed files with 45 additions and 1 deletions

View File

@ -0,0 +1,37 @@
commit f9c8f9ec091ad232c0a291904f7839d665d098e0
Author: jzmaddock <john@johnmaddock.co.uk>
Date: Thu Mar 3 10:52:03 2016 +0000
Add some needed casts for cases where limb_type is wider than unsigned int.
diff --git a/include/boost/multiprecision/cpp_int.hpp b/include/boost/multiprecision/cpp_int.hpp
index 60ad876..b868167 100644
--- a/include/boost/multiprecision/cpp_int.hpp
+++ b/include/boost/multiprecision/cpp_int.hpp
@@ -190,7 +190,7 @@ private:
public:
BOOST_STATIC_CONSTANT(unsigned, limb_bits = sizeof(limb_type) * CHAR_BIT);
BOOST_STATIC_CONSTANT(limb_type, max_limb_value = ~static_cast<limb_type>(0u));
- BOOST_STATIC_CONSTANT(limb_type, sign_bit_mask = 1u << (limb_bits - 1));
+ BOOST_STATIC_CONSTANT(limb_type, sign_bit_mask = static_cast<limb_type>(1u) << (limb_bits - 1));
BOOST_STATIC_CONSTANT(unsigned, internal_limb_count =
MinBits
? (MinBits / limb_bits + ((MinBits % limb_bits) ? 1 : 0))
@@ -413,7 +413,7 @@ struct cpp_int_base<MinBits, MinBits, signed_magnitude, Checked, void, false>
public:
BOOST_STATIC_CONSTANT(unsigned, limb_bits = sizeof(limb_type) * CHAR_BIT);
BOOST_STATIC_CONSTANT(limb_type, max_limb_value = ~static_cast<limb_type>(0u));
- BOOST_STATIC_CONSTANT(limb_type, sign_bit_mask = 1u << (limb_bits - 1));
+ BOOST_STATIC_CONSTANT(limb_type, sign_bit_mask = static_cast<limb_type>(1u) << (limb_bits - 1));
BOOST_STATIC_CONSTANT(unsigned, internal_limb_count = MinBits / limb_bits + ((MinBits % limb_bits) ? 1 : 0));
BOOST_STATIC_CONSTANT(bool, variable = false);
BOOST_STATIC_CONSTANT(limb_type, upper_limb_mask = (MinBits % limb_bits) ? (limb_type(1) << (MinBits % limb_bits)) -1 : (~limb_type(0)));
@@ -565,7 +565,7 @@ struct cpp_int_base<MinBits, MinBits, unsigned_magnitude, Checked, void, false>
public:
BOOST_STATIC_CONSTANT(unsigned, limb_bits = sizeof(limb_type) * CHAR_BIT);
BOOST_STATIC_CONSTANT(limb_type, max_limb_value = ~static_cast<limb_type>(0u));
- BOOST_STATIC_CONSTANT(limb_type, sign_bit_mask = 1u << (limb_bits - 1));
+ BOOST_STATIC_CONSTANT(limb_type, sign_bit_mask = static_cast<limb_type>(1u) << (limb_bits - 1));
BOOST_STATIC_CONSTANT(unsigned, internal_limb_count = MinBits / limb_bits + ((MinBits % limb_bits) ? 1 : 0));
BOOST_STATIC_CONSTANT(bool, variable = false);
BOOST_STATIC_CONSTANT(limb_type, upper_limb_mask = (MinBits % limb_bits) ? (limb_type(1) << (MinBits % limb_bits)) -1 : (~limb_type(0)));

View File

@ -38,7 +38,7 @@ Name: boost
Summary: The free peer-reviewed portable C++ source libraries
Version: 1.60.0
%global version_enc 1_60_0
Release: 5%{?dist}
Release: 6%{?dist}
License: Boost and MIT and Python
%global toplev_dirname %{name}_%{version_enc}
@ -131,6 +131,9 @@ Patch68: boost-1.58.0-address-model.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1262444
Patch81: boost-1.59-test-fenv.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1349638
Patch83: boost-1.60-multiprecision.patch
%bcond_with tests
%bcond_with docs_generated
@ -641,6 +644,7 @@ a number of significant features and is now developed independently
%patch65 -p1
%patch68 -p1
%patch81 -p2
%patch83 -p2
# At least python2_version needs to be a macro so that it's visible in
# %%install as well.
@ -1269,6 +1273,9 @@ fi
%{_mandir}/man1/bjam.1*
%changelog
* Tue Jun 28 2016 Jonathan Wakely <jwakely@redhat.com> - 1.60.0-8
- Add patch for Boost.Multiprecision (#1349638)
* Thu May 19 2016 Jonathan Wakely <jwakely@redhat.com> - 1.60.0-5
- Rebuilt for GCC 6.1 (#1331983)