mirror of
https://github.com/marzer/tomlplusplus.git
synced 2025-02-23 00:39:54 +00:00
fixed std::numeric_limits::max() getting broken by macros in some environments
This commit is contained in:
parent
ab85988d59
commit
7fb4dbbb6d
@ -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
|
||||
);
|
||||
|
2
toml.hpp
2
toml.hpp
@ -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
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user