fixed std::numeric_limits::max() getting broken by macros in some environments

This commit is contained in:
Mark Gillard 2020-06-21 00:02:59 +03:00
parent ab85988d59
commit 7fb4dbbb6d
2 changed files with 2 additions and 2 deletions

View File

@ -1423,7 +1423,7 @@ namespace toml::impl
}
// range check
if (result > static_cast<uint64_t>(std::numeric_limits<int64_t>::max()) + (sign < 0 ? 1ull : 0ull))
if (result > static_cast<uint64_t>((std::numeric_limits<int64_t>::max)()) + (sign < 0 ? 1ull : 0ull))
set_error_and_return_default(
"'"sv, std::string_view{ chars, length }, "' is not representable in 64 bits"sv
);

View File

@ -8100,7 +8100,7 @@ namespace toml::impl
}
// range check
if (result > static_cast<uint64_t>(std::numeric_limits<int64_t>::max()) + (sign < 0 ? 1ull : 0ull))
if (result > static_cast<uint64_t>((std::numeric_limits<int64_t>::max)()) + (sign < 0 ? 1ull : 0ull))
set_error_and_return_default(
"'"sv, std::string_view{ chars, length }, "' is not representable in 64 bits"sv
);