Merge pull request #1302 from chwarr/min-max-guard
Guard against min/max being macros in reader.h
This commit is contained in:
commit
08b1a8a41e
@ -79,12 +79,12 @@ static void Verify(void(*f)(T, char*), char* (*g)(T, char*)) {
|
||||
do {
|
||||
VerifyValue<T>(i - 1, f, g);
|
||||
VerifyValue<T>(i, f, g);
|
||||
if (std::numeric_limits<T>::min() < 0) {
|
||||
if ((std::numeric_limits<T>::min)() < 0) {
|
||||
VerifyValue<T>(Traits<T>::Negate(i), f, g);
|
||||
VerifyValue<T>(Traits<T>::Negate(i + 1), f, g);
|
||||
}
|
||||
last = i;
|
||||
if (i > static_cast<T>(std::numeric_limits<T>::max() / static_cast<T>(power)))
|
||||
if (i > static_cast<T>((std::numeric_limits<T>::max)() / static_cast<T>(power)))
|
||||
break;
|
||||
i *= static_cast<T>(power);
|
||||
} while (last < i);
|
||||
|
@ -422,7 +422,7 @@ static void TestParseDouble() {
|
||||
"67546703537516986049910576551282076245490090389328944075868508455133942"
|
||||
"30458323690322294816580855933212334827479782620414472316873817718091929"
|
||||
"9881250404026184124858368",
|
||||
std::numeric_limits<double>::max());
|
||||
(std::numeric_limits<double>::max)());
|
||||
|
||||
TEST_DOUBLE(fullPrecision,
|
||||
"243546080556034731077856379609316893158278902575447060151047"
|
||||
|
Loading…
x
Reference in New Issue
Block a user