Disable some constexpr calculations with MSVC

This commit is contained in:
Matt Borland
2023-05-30 10:57:26 +02:00
parent 1070362ee9
commit 44d6cb751c
2 changed files with 19 additions and 4 deletions

View File

@@ -193,9 +193,11 @@ static_assert((BOOST_CHARCONV_ENDIAN_BIG_BYTE || BOOST_CHARCONV_ENDIAN_LITTLE_BY
#ifdef __has_include
# if __has_include(<bit>)
# include <bit>
# if __cpp_lib_bit_cast >= 201806L
# define BOOST_CHARCONV_HAS_STD_BITCAST
# if __cplusplus >= 202002L || BOOST_MSVC >= 202002L
# include <bit>
# if __cpp_lib_bit_cast >= 201806L
# define BOOST_CHARCONV_HAS_STD_BITCAST
# endif
# endif
# endif
#endif

View File

@@ -271,7 +271,11 @@ BOOST_FORCEINLINE BOOST_CHARCONV_CXX20_CONSTEXPR limb scalar_add(limb x, limb y,
}
// multiply two small integers, getting both the high and low bits.
BOOST_FORCEINLINE BOOST_CHARCONV_CXX20_CONSTEXPR limb scalar_mul(limb x, limb y, limb& carry) noexcept
BOOST_FORCEINLINE
#ifndef BOOST_MSVC
BOOST_CHARCONV_CXX20_CONSTEXPR
#endif
limb scalar_mul(limb x, limb y, limb& carry) noexcept
{
#ifdef BOOST_CHARCONV_FASTFLOAT_64BIT
# ifdef BOOST_CHARCONV_HAS_INT128
@@ -619,6 +623,11 @@ struct bigint : pow5_tables<>
return true;
}
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable: 4996) // Not all versions of MSVC respond as they should to _SCL_NO_WARNINGS
#endif
// move the limbs left by `n` limbs.
BOOST_CHARCONV_CXX20_CONSTEXPR bool shl_limbs(std::size_t n) noexcept
{
@@ -645,6 +654,10 @@ struct bigint : pow5_tables<>
return true;
}
#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
// move the limbs left by `n` bits.
BOOST_CHARCONV_CXX20_CONSTEXPR bool shl(std::size_t n) noexcept
{