Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround for type change in tommath #603

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading