mirror of
https://github.com/shadps4-emu/ext-cryptopp.git
synced 2025-02-17 03:48:38 +00:00
Fix macro and member function confilct for min and max (GH #1214)
This commit is contained in:
parent
0cf084506d
commit
a5f47381b5
14
misc.h
14
misc.h
@ -783,7 +783,7 @@ inline bool SafeConvert(sword32 from, word64 &to)
|
||||
template<>
|
||||
inline bool SafeConvert(word64 from, sword64 &to)
|
||||
{
|
||||
if (from > static_cast<word64>(std::numeric_limits<sword64>::max()))
|
||||
if (from > static_cast<word64>((std::numeric_limits<sword64>::max)()))
|
||||
return false;
|
||||
to = static_cast<sword64>(from);
|
||||
return true;
|
||||
@ -827,7 +827,7 @@ inline bool SafeConvert(sword32 from, sword64 &to)
|
||||
template<>
|
||||
inline bool SafeConvert(word64 from, word32 &to)
|
||||
{
|
||||
if (from > static_cast<word64>(std::numeric_limits<word32>::max()))
|
||||
if (from > static_cast<word64>((std::numeric_limits<word32>::max)()))
|
||||
return false;
|
||||
to = static_cast<word32>(from);
|
||||
return true;
|
||||
@ -845,7 +845,7 @@ inline bool SafeConvert(sword64 from, word32 &to)
|
||||
{
|
||||
if (from < 0)
|
||||
return false;
|
||||
else if (from > static_cast<sword64>(std::numeric_limits<word32>::max()))
|
||||
else if (from > static_cast<sword64>((std::numeric_limits<word32>::max)()))
|
||||
return false;
|
||||
to = static_cast<word32>(from);
|
||||
return true;
|
||||
@ -877,7 +877,7 @@ inline bool SafeConvert(sword32 from, word32 &to)
|
||||
template<>
|
||||
inline bool SafeConvert(word64 from, sword32 &to)
|
||||
{
|
||||
if (from > static_cast<word64>(std::numeric_limits<sword32>::max()))
|
||||
if (from > static_cast<word64>((std::numeric_limits<sword32>::max)()))
|
||||
return false;
|
||||
to = static_cast<sword32>(from);
|
||||
return true;
|
||||
@ -893,9 +893,9 @@ inline bool SafeConvert(word64 from, sword32 &to)
|
||||
template<>
|
||||
inline bool SafeConvert(sword64 from, sword32 &to)
|
||||
{
|
||||
if (from > static_cast<sword64>(std::numeric_limits<sword32>::max()))
|
||||
if (from > static_cast<sword64>((std::numeric_limits<sword32>::max)()))
|
||||
return false;
|
||||
else if (from < static_cast<sword64>(std::numeric_limits<sword32>::min()))
|
||||
else if (from < static_cast<sword64>((std::numeric_limits<sword32>::min)()))
|
||||
return false;
|
||||
to = static_cast<sword32>(from);
|
||||
return true;
|
||||
@ -911,7 +911,7 @@ inline bool SafeConvert(sword64 from, sword32 &to)
|
||||
template<>
|
||||
inline bool SafeConvert(word32 from, sword32 &to)
|
||||
{
|
||||
if (from > static_cast<word32>(std::numeric_limits<sword32>::max()))
|
||||
if (from > static_cast<word32>((std::numeric_limits<sword32>::max)()))
|
||||
return false;
|
||||
to = static_cast<sword32>(from);
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user