Skip to content

Commit

Permalink
Additional max guards for MSVC (#1630)
Browse files Browse the repository at this point in the history
  • Loading branch information
llm96 authored Feb 22, 2025
1 parent c52c1c2 commit e3ccdef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/glaze/util/parse.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1286,7 +1286,7 @@ namespace glz
using S = std::make_signed_t<U>;
// The largest magnitude we can represent in a negative value is (max + 1)
// since -(min()) = max() + 1.
U limit = static_cast<U>(std::numeric_limits<I>::max()) + 1U;
U limit = static_cast<U>((std::numeric_limits<I>::max)()) + 1U;
if (negative) {
if (acc > limit) {
result.ec = std::errc::result_out_of_range;
Expand All @@ -1296,7 +1296,7 @@ namespace glz
value = static_cast<I>(0 - static_cast<S>(acc));
}
else {
if (acc > static_cast<U>(std::numeric_limits<I>::max())) {
if (acc > static_cast<U>((std::numeric_limits<I>::max)())) {
result.ec = std::errc::result_out_of_range;
result.ptr = first;
return result;
Expand Down

0 comments on commit e3ccdef

Please sign in to comment.