Fixed latest build error in msvc platform (#3630)

* Fixed latest build error in msvc platform

warnings in msvc about mix/max macro while windows.h is used in the project #762

* Update for CI

None

* Update single_include/nlohmann/json.hpp

Co-authored-by: Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>

Co-authored-by: Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>
pull/3631/head
KsaNL 2022-07-31 05:03:09 +08:00 committed by GitHub
parent a2578d1d50
commit fc3e64cbf9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 10 deletions

View File

@ -619,7 +619,7 @@ struct value_in_range_of_impl2<OfType, T, false, false>
static constexpr bool test(T val)
{
using CommonType = typename std::common_type<OfType, T>::type;
return static_cast<CommonType>(val) <= static_cast<CommonType>(std::numeric_limits<OfType>::max());
return static_cast<CommonType>(val) <= static_cast<CommonType>((std::numeric_limits<OfType>::max)());
}
};
@ -629,7 +629,7 @@ struct value_in_range_of_impl2<OfType, T, true, false>
static constexpr bool test(T val)
{
using CommonType = typename std::common_type<OfType, T>::type;
return static_cast<CommonType>(val) <= static_cast<CommonType>(std::numeric_limits<OfType>::max());
return static_cast<CommonType>(val) <= static_cast<CommonType>((std::numeric_limits<OfType>::max)());
}
};
@ -639,7 +639,7 @@ struct value_in_range_of_impl2<OfType, T, false, true>
static constexpr bool test(T val)
{
using CommonType = typename std::common_type<OfType, T>::type;
return val >= 0 && static_cast<CommonType>(val) <= static_cast<CommonType>(std::numeric_limits<OfType>::max());
return val >= 0 && static_cast<CommonType>(val) <= static_cast<CommonType>((std::numeric_limits<OfType>::max)());
}
};
@ -650,8 +650,8 @@ struct value_in_range_of_impl2<OfType, T, true, true>
static constexpr bool test(T val)
{
using CommonType = typename std::common_type<OfType, T>::type;
return static_cast<CommonType>(val) >= static_cast<CommonType>(std::numeric_limits<OfType>::min())
&& static_cast<CommonType>(val) <= static_cast<CommonType>(std::numeric_limits<OfType>::max());
return static_cast<CommonType>(val) >= static_cast<CommonType>((std::numeric_limits<OfType>::min)())
&& static_cast<CommonType>(val) <= static_cast<CommonType>((std::numeric_limits<OfType>::max)());
}
};

View File

@ -3977,7 +3977,7 @@ struct value_in_range_of_impl2<OfType, T, false, false>
static constexpr bool test(T val)
{
using CommonType = typename std::common_type<OfType, T>::type;
return static_cast<CommonType>(val) <= static_cast<CommonType>(std::numeric_limits<OfType>::max());
return static_cast<CommonType>(val) <= static_cast<CommonType>((std::numeric_limits<OfType>::max)());
}
};
@ -3987,7 +3987,7 @@ struct value_in_range_of_impl2<OfType, T, true, false>
static constexpr bool test(T val)
{
using CommonType = typename std::common_type<OfType, T>::type;
return static_cast<CommonType>(val) <= static_cast<CommonType>(std::numeric_limits<OfType>::max());
return static_cast<CommonType>(val) <= static_cast<CommonType>((std::numeric_limits<OfType>::max)());
}
};
@ -3997,7 +3997,7 @@ struct value_in_range_of_impl2<OfType, T, false, true>
static constexpr bool test(T val)
{
using CommonType = typename std::common_type<OfType, T>::type;
return val >= 0 && static_cast<CommonType>(val) <= static_cast<CommonType>(std::numeric_limits<OfType>::max());
return val >= 0 && static_cast<CommonType>(val) <= static_cast<CommonType>((std::numeric_limits<OfType>::max)());
}
};
@ -4008,8 +4008,8 @@ struct value_in_range_of_impl2<OfType, T, true, true>
static constexpr bool test(T val)
{
using CommonType = typename std::common_type<OfType, T>::type;
return static_cast<CommonType>(val) >= static_cast<CommonType>(std::numeric_limits<OfType>::min())
&& static_cast<CommonType>(val) <= static_cast<CommonType>(std::numeric_limits<OfType>::max());
return static_cast<CommonType>(val) >= static_cast<CommonType>((std::numeric_limits<OfType>::min)())
&& static_cast<CommonType>(val) <= static_cast<CommonType>((std::numeric_limits<OfType>::max)());
}
};