Workaround for MSVC14.3 gotos in if constexpr blocks

This commit is contained in:
Matt Borland
2023-03-29 17:27:13 +02:00
parent 5e72e5deca
commit 05aa3c2a2d
2 changed files with 10 additions and 3 deletions

View File

@@ -102,4 +102,11 @@ static_assert((BOOST_CHARCONV_ENDIAN_BIG_BYTE || BOOST_CHARCONV_ENDIAN_LITTLE_BY
#define BOOST_CHARCONV_HAS_BUILTIN(x) false
#endif
// Workaround for errors in MSVC 14.3 with gotos in if constexpr blocks
#if defined(_MSC_VER) && _MSC_VER == 1933
# define BOOST_CHARCONV_IF_CONSTEXPR if
#else
# define BOOST_CHARCONV_IF_CONSTEXPR BOOST_IF_CONSTEXPR
#endif
#endif // BOOST_CHARCONV_DETAIL_CONFIG_HPP

View File

@@ -3065,7 +3065,7 @@ namespace jkj { namespace floff {
fixed_point_calculator<ExtendedCache::max_cache_blocks>::discard_upper(
significand, blocks, cache_block_count);
BOOST_IF_CONSTEXPR (ExtendedCache::segment_length == 22) {
BOOST_CHARCONV_IF_CONSTEXPR (ExtendedCache::segment_length == 22) {
// No rounding, continue.
if (remaining_digits > digits_in_the_second_segment) {
remaining_digits -= digits_in_the_second_segment;
@@ -3792,7 +3792,7 @@ namespace jkj { namespace floff {
}
} // ExtendedCache::segment_length == 22
else BOOST_IF_CONSTEXPR (ExtendedCache::segment_length == 252) {
else BOOST_CHARCONV_IF_CONSTEXPR (ExtendedCache::segment_length == 252) {
int overlapping_digits = 252 - digits_in_the_second_segment;
int remaining_subsegment_pairs = 14;
@@ -4217,7 +4217,7 @@ case n:
fixed_point_calculator<ExtendedCache::max_cache_blocks>::discard_upper(
significand, blocks, cache_block_count);
BOOST_IF_CONSTEXPR (ExtendedCache::segment_length == 22) {
BOOST_CHARCONV_IF_CONSTEXPR (ExtendedCache::segment_length == 22) {
// When at least two subsegments left.
if (remaining_digits > 16) {
std::uint64_t first_second_subsegments =