From ff477104d552d794e6ee82d54c441942d10409c2 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Wed, 28 Feb 2024 11:59:51 +0100 Subject: [PATCH] Workaround for type change in tommath --- include/boost/multiprecision/tommath.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/boost/multiprecision/tommath.hpp b/include/boost/multiprecision/tommath.hpp index 80b40393e..363b3be1e 100644 --- a/include/boost/multiprecision/tommath.hpp +++ b/include/boost/multiprecision/tommath.hpp @@ -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 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));