diff --git a/include/boost/charconv/detail/bit_layouts.hpp b/include/boost/charconv/detail/bit_layouts.hpp index 498b5bb8..5ae37b07 100644 --- a/boost/charconv/detail/bit_layouts.hpp +++ b/boost/charconv/detail/bit_layouts.hpp @@ -127,6 +127,7 @@ struct IEEEl2bits #else // Unsupported long double representation # define BOOST_MATH_UNSUPPORTED_LONG_DOUBLE +# define BOOST_CHARCONV_LDBL_BITS -1 #endif struct IEEEbinary128 diff --git a/include/boost/charconv/from_chars.hpp b/include/boost/charconv/from_chars.hpp index 50f911ae..44141149 100644 --- a/boost/charconv/from_chars.hpp +++ b/boost/charconv/from_chars.hpp @@ -139,7 +139,10 @@ BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(boost::core::string_v BOOST_CHARCONV_DECL from_chars_result from_chars_erange(const char* first, const char* last, float& value, chars_format fmt = chars_format::general) noexcept; BOOST_CHARCONV_DECL from_chars_result from_chars_erange(const char* first, const char* last, double& value, chars_format fmt = chars_format::general) noexcept; + +#ifndef BOOST_MATH_UNSUPPORTED_LONG_DOUBLE BOOST_CHARCONV_DECL from_chars_result from_chars_erange(const char* first, const char* last, long double& value, chars_format fmt = chars_format::general) noexcept; +#endif #ifdef BOOST_CHARCONV_HAS_QUADMATH BOOST_CHARCONV_DECL from_chars_result from_chars_erange(const char* first, const char* last, __float128& value, chars_format fmt = chars_format::general) noexcept; @@ -164,7 +167,10 @@ BOOST_CHARCONV_DECL from_chars_result from_chars_erange(const char* first, const BOOST_CHARCONV_DECL from_chars_result from_chars_erange(boost::core::string_view sv, float& value, chars_format fmt = chars_format::general) noexcept; BOOST_CHARCONV_DECL from_chars_result from_chars_erange(boost::core::string_view sv, double& value, chars_format fmt = chars_format::general) noexcept; + +#ifndef BOOST_MATH_UNSUPPORTED_LONG_DOUBLE BOOST_CHARCONV_DECL from_chars_result from_chars_erange(boost::core::string_view sv, long double& value, chars_format fmt = chars_format::general) noexcept; +#endif #ifdef BOOST_CHARCONV_HAS_FLOAT128 BOOST_CHARCONV_DECL from_chars_result from_chars_erange(boost::core::string_view sv, __float128& value, chars_format fmt = chars_format::general) noexcept; @@ -193,7 +199,10 @@ BOOST_CHARCONV_DECL from_chars_result from_chars_erange(boost::core::string_view BOOST_CHARCONV_DECL from_chars_result from_chars(const char* first, const char* last, float& value, chars_format fmt = chars_format::general) noexcept; BOOST_CHARCONV_DECL from_chars_result from_chars(const char* first, const char* last, double& value, chars_format fmt = chars_format::general) noexcept; + +#ifndef BOOST_MATH_UNSUPPORTED_LONG_DOUBLE BOOST_CHARCONV_DECL from_chars_result from_chars(const char* first, const char* last, long double& value, chars_format fmt = chars_format::general) noexcept; +#endif #ifdef BOOST_CHARCONV_HAS_FLOAT128 BOOST_CHARCONV_DECL from_chars_result from_chars(const char* first, const char* last, __float128& value, chars_format fmt = chars_format::general) noexcept; @@ -216,7 +225,10 @@ BOOST_CHARCONV_DECL from_chars_result from_chars(const char* first, const char* BOOST_CHARCONV_DECL from_chars_result from_chars(boost::core::string_view sv, float& value, chars_format fmt = chars_format::general) noexcept; BOOST_CHARCONV_DECL from_chars_result from_chars(boost::core::string_view sv, double& value, chars_format fmt = chars_format::general) noexcept; + +#ifndef BOOST_MATH_UNSUPPORTED_LONG_DOUBLE BOOST_CHARCONV_DECL from_chars_result from_chars(boost::core::string_view sv, long double& value, chars_format fmt = chars_format::general) noexcept; +#endif #ifdef BOOST_CHARCONV_HAS_FLOAT128 BOOST_CHARCONV_DECL from_chars_result from_chars(boost::core::string_view sv, __float128& value, chars_format fmt = chars_format::general) noexcept; diff --git a/src/from_chars.cpp b/src/from_chars.cpp index bbfaff29..8c450b0a 100644 --- a/libs/charconv/src/from_chars.cpp +++ n/libs/charconv/src/from_chars.cpp @@ -229,7 +229,7 @@ boost::charconv::from_chars_result boost::charconv::from_chars_erange(const char return r; } -#else +#elif !defined(BOOST_MATH_UNSUPPORTED_LONG_DOUBLE) boost::charconv::from_chars_result boost::charconv::from_chars_erange(const char* first, const char* last, long double& value, boost::charconv::chars_format fmt) noexcept { @@ -323,10 +323,12 @@ boost::charconv::from_chars_result boost::charconv::from_chars_erange(boost::cor return boost::charconv::from_chars_erange(sv.data(), sv.data() + sv.size(), value, fmt); } +#ifndef BOOST_MATH_UNSUPPORTED_LONG_DOUBLE boost::charconv::from_chars_result boost::charconv::from_chars_erange(boost::core::string_view sv, long double& value, boost::charconv::chars_format fmt) noexcept { return boost::charconv::from_chars_erange(sv.data(), sv.data() + sv.size(), value, fmt); } +#endif #ifdef BOOST_CHARCONV_HAS_QUADMATH boost::charconv::from_chars_result boost::charconv::from_chars_erange(boost::core::string_view sv, __float128& value, boost::charconv::chars_format fmt) noexcept @@ -396,10 +398,12 @@ boost::charconv::from_chars_result boost::charconv::from_chars(const char* first return from_chars_strict_impl(first, last, value, fmt); } +#ifndef BOOST_MATH_UNSUPPORTED_LONG_DOUBLE boost::charconv::from_chars_result boost::charconv::from_chars(const char* first, const char* last, long double& value, boost::charconv::chars_format fmt) noexcept { return from_chars_strict_impl(first, last, value, fmt); } +#endif #ifdef BOOST_CHARCONV_HAS_QUADMATH boost::charconv::from_chars_result boost::charconv::from_chars(const char* first, const char* last, __float128& value, boost::charconv::chars_format fmt) noexcept @@ -453,10 +457,12 @@ boost::charconv::from_chars_result boost::charconv::from_chars(boost::core::stri return from_chars_strict_impl(sv.data(), sv.data() + sv.size(), value, fmt); } +#ifndef BOOST_MATH_UNSUPPORTED_LONG_DOUBLE boost::charconv::from_chars_result boost::charconv::from_chars(boost::core::string_view sv, long double& value, boost::charconv::chars_format fmt) noexcept { return from_chars_strict_impl(sv.data(), sv.data() + sv.size(), value, fmt); } +#endif #ifdef BOOST_CHARCONV_HAS_QUADMATH boost::charconv::from_chars_result boost::charconv::from_chars(boost::core::string_view sv, __float128& value, boost::charconv::chars_format fmt) noexcept