@@ -29,14 +29,6 @@ RAPIDJSON_DIAG_PUSH
29
29
#ifdef _MSC_VER
30
30
RAPIDJSON_DIAG_OFF (4127 ) // conditional expression is constant
31
31
RAPIDJSON_DIAG_OFF(4244 ) // conversion from kXxxFlags to 'uint16_t', possible loss of data
32
- #ifdef _MINWINDEF_ // see: http://stackoverflow.com/questions/22744262/cant-call-stdmax-because-minwindef-h-defines-max
33
- #ifndef NOMINMAX
34
- #pragma push_macro("min")
35
- #pragma push_macro("max")
36
- #undef min
37
- #undef max
38
- #endif
39
- #endif
40
32
#endif
41
33
42
34
#ifdef __clang__
@@ -1018,14 +1010,14 @@ class GenericValue {
1018
1010
uint64_t u = GetUint64 ();
1019
1011
volatile double d = static_cast <double >(u);
1020
1012
return (d >= 0.0 )
1021
- && (d < static_cast <double >(std::numeric_limits<uint64_t >::max ()))
1013
+ && (d < static_cast <double >(( std::numeric_limits<uint64_t >::max) ()))
1022
1014
&& (u == static_cast <uint64_t >(d));
1023
1015
}
1024
1016
if (IsInt64 ()) {
1025
1017
int64_t i = GetInt64 ();
1026
1018
volatile double d = static_cast <double >(i);
1027
- return (d >= static_cast <double >(std::numeric_limits<int64_t >::min ()))
1028
- && (d < static_cast <double >(std::numeric_limits<int64_t >::max ()))
1019
+ return (d >= static_cast <double >(( std::numeric_limits<int64_t >::min) ()))
1020
+ && (d < static_cast <double >(( std::numeric_limits<int64_t >::max) ()))
1029
1021
&& (i == static_cast <int64_t >(d));
1030
1022
}
1031
1023
return true ; // double, int, uint are always lossless
@@ -1042,8 +1034,8 @@ class GenericValue {
1042
1034
bool IsLosslessFloat () const {
1043
1035
if (!IsNumber ()) return false ;
1044
1036
double a = GetDouble ();
1045
- if (a < static_cast <double >(-std::numeric_limits<float >::max ())
1046
- || a > static_cast <double >(std::numeric_limits<float >::max ()))
1037
+ if (a < static_cast <double >(-( std::numeric_limits<float >::max) ())
1038
+ || a > static_cast <double >(( std::numeric_limits<float >::max) ()))
1047
1039
return false ;
1048
1040
double b = static_cast <double >(static_cast <float >(a));
1049
1041
return a >= b && a <= b; // Prevent -Wfloat-equal
@@ -2616,12 +2608,6 @@ class GenericObject {
2616
2608
};
2617
2609
2618
2610
RAPIDJSON_NAMESPACE_END
2619
- #ifdef _MINWINDEF_ // see: http://stackoverflow.com/questions/22744262/cant-call-stdmax-because-minwindef-h-defines-max
2620
- #ifndef NOMINMAX
2621
- #pragma pop_macro("min")
2622
- #pragma pop_macro("max")
2623
- #endif
2624
- #endif
2625
2611
RAPIDJSON_DIAG_POP
2626
2612
2627
2613
#endif // RAPIDJSON_DOCUMENT_H_
0 commit comments