Skip to content

Commit

Permalink
Workaround for type change in tommath
Browse files Browse the repository at this point in the history
  • Loading branch information
mborland committed Feb 28, 2024
1 parent 2766661 commit ff47710
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/boost/multiprecision/tommath.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,14 @@ struct tommath_int
if ((base != 10) && m_data.sign)
BOOST_MP_THROW_EXCEPTION(std::runtime_error("Formatted output in bases 8 or 16 is only available for positive numbers"));

// Check against known removed macro that was removed around the same time as type was changed
#ifdef mp_tobinary
int s;
#else
size_t s;
#endif
detail::check_tommath_result(mp_radix_size(const_cast< ::mp_int*>(&m_data), base, &s));

std::unique_ptr<char[]> a(new char[s + 1]);
#ifndef mp_to_binary
detail::check_tommath_result(mp_toradix_n(const_cast< ::mp_int*>(&m_data), a.get(), base, s + 1));
Expand Down

0 comments on commit ff47710

Please sign in to comment.