From ec239e0e04c1cfea4a029ddd1e538b2feb1f41eb Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Tue, 21 Jul 2026 11:26:09 +0200 Subject: [PATCH 1/2] Fix compat with max() macro --- include/fast_float/ascii_number.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/fast_float/ascii_number.h b/include/fast_float/ascii_number.h index 2bad1fb1..2748d65a 100644 --- a/include/fast_float/ascii_number.h +++ b/include/fast_float/ascii_number.h @@ -804,7 +804,7 @@ parse_int_string(UC const *p, UC const *pend, T &value, // check other types overflow if (!std::is_same::value) { - if (i > uint64_t(std::numeric_limits::max()) + uint64_t(negative)) { + if (i > uint64_t((std::numeric_limits::max)()) + uint64_t(negative)) { answer.ec = std::errc::result_out_of_range; return answer; } @@ -821,8 +821,8 @@ parse_int_string(UC const *p, UC const *pend, T &value, // - reinterpret_casting (~i + 1) would work, but it is not constexpr // this is always optimized into a neg instruction (note: T is an integer // type) - value = T(-std::numeric_limits::max() - - T(i - uint64_t(std::numeric_limits::max()))); + value = T(-(std::numeric_limits::max)() - + T(i - uint64_t((std::numeric_limits::max)()))); #ifdef FASTFLOAT_VISUAL_STUDIO #pragma warning(pop) #endif From c335514c6e98e952b9b33fa357fee878a0b0be54 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Thu, 23 Jul 2026 09:58:09 +0200 Subject: [PATCH 2/2] Fix compat with min() macro --- include/fast_float/parse_number.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/fast_float/parse_number.h b/include/fast_float/parse_number.h index c819c8a7..58cdafd5 100644 --- a/include/fast_float/parse_number.h +++ b/include/fast_float/parse_number.h @@ -96,7 +96,7 @@ fastfloat_really_inline bool rounds_to_nearest() noexcept { // asm). The value does not need to be std::numeric_limits::min(), any // small value so that 1 + x should round to 1 would do (after accounting for // excess precision, as in 387 instructions). - static float volatile fmin = std::numeric_limits::min(); + static float volatile fmin = (std::numeric_limits::min)(); float fmini = fmin; // we copy it so that it gets loaded at most once. // // Explanation: