Remove FASTFLOAT_CONSTEVAL20 that I was added before and cleanup diff.

This commit is contained in:
IRainman 2025-03-28 18:57:37 +03:00
parent fc9f61efc9
commit ed871096ad
2 changed files with 5 additions and 9 deletions

View File

@ -208,8 +208,7 @@ template <typename UC>
template <typename UC, FASTFLOAT_ENABLE_IF(!has_simd_opt<UC>()) = 0> template <typename UC, FASTFLOAT_ENABLE_IF(!has_simd_opt<UC>()) = 0>
#endif #endif
// dummy for compile // dummy for compile
FASTFLOAT_CONSTEVAL20 bool simd_parse_if_eight_digits_unrolled(UC const *, bool simd_parse_if_eight_digits_unrolled(UC const *, uint64_t &) {
uint64_t &) {
return 0; return 0;
} }
@ -304,9 +303,8 @@ parse_number_string(UC const *p, UC const *pend,
#ifndef FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN #ifndef FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN
answer.negative = (*p == UC('-')); answer.negative = (*p == UC('-'));
// C++17 20.19.3.(7.1) explicitly forbids '+' sign here // C++17 20.19.3.(7.1) explicitly forbids '+' sign here
if (*p == UC('-') || if ((*p == UC('-')) || (uint64_t(options.format & chars_format::allow_leading_plus) &&
(uint64_t(options.format & chars_format::allow_leading_plus) && !basic_json_fmt && *p == UC('+'))) {
*p == UC('+'))) {
++p; ++p;
if (p == pend) { if (p == pend) {
return report_parse_error<UC>( return report_parse_error<UC>(
@ -320,8 +318,8 @@ parse_number_string(UC const *p, UC const *pend,
} }
else { else {
if (!is_integer(*p) && if (!is_integer(*p) &&
(*p != options.decimal_point)) { // a sign must be followed by an (*p !=
// integer or the dot options.decimal_point)) { // a sign must be followed by an integer or the dot
return report_parse_error<UC>( return report_parse_error<UC>(
p, parse_error::missing_integer_or_dot_after_sign); p, parse_error::missing_integer_or_dot_after_sign);
} }

View File

@ -44,11 +44,9 @@
defined(__cpp_lib_constexpr_algorithms) && \ defined(__cpp_lib_constexpr_algorithms) && \
__cpp_lib_constexpr_algorithms >= 201806L /*For std::copy and std::fill*/ __cpp_lib_constexpr_algorithms >= 201806L /*For std::copy and std::fill*/
#define FASTFLOAT_CONSTEXPR20 constexpr #define FASTFLOAT_CONSTEXPR20 constexpr
#define FASTFLOAT_CONSTEVAL20 consteval
#define FASTFLOAT_IS_CONSTEXPR 1 #define FASTFLOAT_IS_CONSTEXPR 1
#else #else
#define FASTFLOAT_CONSTEXPR20 #define FASTFLOAT_CONSTEXPR20
#define FASTFLOAT_CONSTEVAL20 FASTFLOAT_CONSTEXPR14
#define FASTFLOAT_IS_CONSTEXPR 0 #define FASTFLOAT_IS_CONSTEXPR 0
#endif #endif