Skip to content

Commit

Permalink
Guard against max being macros in schema.h
Browse files Browse the repository at this point in the history
Similar to:
Issue - #1033
Solution - 6e38649

Fix std::numeric_limits::max() compilation confusion on Windows
  • Loading branch information
SilverPlate3 authored and miloyip committed Dec 10, 2024
1 parent 9b5cad1 commit 58c6938
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions include/rapidjson/schema.h
Original file line number Diff line number Diff line change
Expand Up @@ -1645,8 +1645,7 @@ class Schema {
double qRounded = std::floor(q + 0.5);
double scaledEpsilon = (q + qRounded) * std::numeric_limits<double>::epsilon();
double difference = std::abs(qRounded - q);
bool isMultiple = (difference <= scaledEpsilon)
|| (difference < std::numeric_limits<double>::min());
bool isMultiple = difference <= scaledEpsilon || difference < (std::numeric_limits<double>::min)();
if (!isMultiple) {
context.error_handler.NotMultipleOf(d, multipleOf_);
RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorMultipleOf);
Expand Down

0 comments on commit 58c6938

Please sign in to comment.