Skip to content

Commit

Permalink
Merge pull request #607 from boostorg/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
mborland authored Mar 5, 2024
2 parents a1f1fd3 + ffe506a commit c3d0cea
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 c3d0cea

Please sign in to comment.