Remove workarounds for missing u128 type

This commit is contained in:
Matt Borland
2023-06-12 10:37:09 +02:00
parent c03baf1c80
commit 8518588e83
3 changed files with 10 additions and 8 deletions

View File

@@ -424,13 +424,13 @@ struct floating_decimal_128 double_to_fd128(double d) noexcept
struct floating_decimal_128 long_double_to_fd128(long double d) noexcept
{
#ifndef BOOST_CHARCONV_HAS_INT128
#ifdef BOOST_CHARCONV_HAS_INT128
unsigned_128_type bits = 0;
std::memcpy(&bits, &d, sizeof(long double));
#else
trivial_uint128 trivial_bits;
std::memcpy(&trivial_bits, &d, sizeof(long double));
unsigned_128_type bits {trivial_bits};
#else
unsigned_128_type bits = 0;
std::memcpy(&bits, &d, sizeof(long double));
#endif
#ifdef BOOST_CHARCONV_DEBUG

View File

@@ -854,7 +854,7 @@ BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, double val
BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, long double value,
chars_format fmt = chars_format::general, int precision = -1 ) noexcept;
#if defined(BOOST_CHARCONV_HAS_FLOAT128) && defined(BOOST_CHARCONV_HAS_INT128)
#ifdef BOOST_CHARCONV_HAS_FLOAT128
BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, __float128 value,
chars_format fmt = chars_format::general, int precision = -1 ) noexcept;
#endif

View File

@@ -4,6 +4,8 @@
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/charconv/detail/ryu/ryu_generic_128.hpp>
#include <boost/charconv/detail/issignaling.hpp>
#include <boost/charconv/to_chars.hpp>
#include <boost/charconv/chars_format.hpp>
#include <cstring>
@@ -11,7 +13,7 @@
#include <cstdint>
#include <cmath>
#ifdef BOOST_CHARCONV_HAS_INT128
#if (BOOST_CHARCONV_LDBL_BITS == 80 || BOOST_CHARCONV_LDBL_BITS == 128)
# include <boost/charconv/detail/ryu/ryu_generic_128.hpp>
# include <boost/charconv/detail/issignaling.hpp>
#endif
@@ -583,7 +585,7 @@ boost::charconv::to_chars_result boost::charconv::to_chars(char* first, char* la
return boost::charconv::detail::to_chars_float_impl(first, last, static_cast<double>(value), fmt, precision);
}
#elif (BOOST_CHARCONV_LDBL_BITS == 80 || BOOST_CHARCONV_LDBL_BITS == 128) && defined(BOOST_CHARCONV_HAS_INT128)
#elif (BOOST_CHARCONV_LDBL_BITS == 80 || BOOST_CHARCONV_LDBL_BITS == 128)
boost::charconv::to_chars_result boost::charconv::to_chars(char* first, char* last, long double value,
boost::charconv::chars_format fmt, int precision) noexcept
@@ -711,7 +713,7 @@ boost::charconv::to_chars_result boost::charconv::to_chars( char* first, char* l
#endif
#if defined(BOOST_CHARCONV_HAS_FLOAT128) && defined(BOOST_CHARCONV_HAS_INT128)
#ifdef BOOST_CHARCONV_HAS_FLOAT128
boost::charconv::to_chars_result boost::charconv::to_chars(char* first, char* last, __float128 value, boost::charconv::chars_format fmt, int precision) noexcept
{