Merge remote-tracking branch 'origin/develop' into float_from_chars

This commit is contained in:
Matt Borland
2023-02-21 11:00:44 -08:00
3 changed files with 17 additions and 10 deletions

View File

@@ -12,7 +12,6 @@
#include <boost/config.hpp>
#include <type_traits>
#include <limits>
#include <array>
#include <cstdlib>
#include <cerrno>
#include <cstddef>
@@ -45,8 +44,8 @@ struct from_chars_result
namespace detail {
static constexpr std::array<unsigned char, 256> uchar_values =
{{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
static constexpr unsigned char uchar_values[] =
{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 255, 255, 255, 255, 255, 255,
@@ -61,7 +60,9 @@ static constexpr std::array<unsigned char, 256> uchar_values =
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}};
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255};
static_assert(sizeof(uchar_values) == 256, "uchar_values should represent all 256 values of unsigned char");
// Convert characters for 0-9, A-Z, a-z to 0-35. Anything else is 255
constexpr unsigned char digit_from_char(char val) noexcept
@@ -74,6 +75,10 @@ constexpr unsigned char digit_from_char(char val) noexcept
# pragma warning(disable: 4146) // unary minus operator applied to unsigned type, result still unsigned
# pragma warning(disable: 4189) // 'is_negative': local variable is initialized but not referenced
#elif defined(__clang__) && defined(__APPLE__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wconstant-conversion"
#elif defined(__GNUC__) && (__GNUC__ < 7)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Woverflow"
@@ -234,6 +239,8 @@ BOOST_CXX14_CONSTEXPR from_chars_result from_chars_integer_impl(const char* firs
#ifdef BOOST_MSVC
# pragma warning(pop)
#elif defined(__clang__) && defined(__APPLE__)
# pragma clang diagnostic pop
#elif defined(__GNUC__) && (__GNUC__ < 7)
# pragma GCC diagnostic pop
#endif

View File

@@ -172,16 +172,16 @@ int main()
test_integral<long long>();
test_integral<unsigned long long>();
#if !defined(__CYGWIN__)
#if !defined(__CYGWIN__) && !defined(__s390x__) && !((defined(__arm__) || defined(__aarch64__)) && !defined(__APPLE__)) && !(defined(__APPLE__) && (__clang_major__ == 12))
// the stub implementations fail under Cygwin;
// the stub implementations fail under Cygwin, s390x, linux ARM, and Apple Clang w/Xcode 12.2;
// re-enable these when we have real ones
test_floating_point<float>();
test_floating_point<double>();
test_floating_point<long double>();
#endif // !defined(__CYGWIN__)
#endif // Broken Platforms
#ifdef BOOST_CHARCONV_HAS_INT128

View File

@@ -296,9 +296,9 @@ int main()
#endif
}
#if !defined(__CYGWIN__)
#if !defined(__CYGWIN__) && !defined(__s390x__) && !((defined(__arm__) || defined(__aarch64__)) && !defined(__APPLE__)) && !(defined(__APPLE__) && (__clang_major__ == 12))
// the stub implementations fail under Cygwin;
// the stub implementations fail under Cygwin, s390x, linux ARM, and Apple Clang w/Xcode 12.2;
// re-enable these when we have real ones
// float
@@ -368,7 +368,7 @@ int main()
test_roundtrip_bv<long double>();
}
#endif // !defined(__CYGWIN__)
#endif // Broken platforms
return boost::report_errors();
}