patch mpfr c++ copy to fix warnings and min/max issues

This commit is contained in:
Gael Guennebaud 2012-06-21 09:59:44 +02:00
parent b5093e2585
commit 7380592bc2
3 changed files with 7 additions and 6 deletions

View File

@ -1267,7 +1267,7 @@ int mspace_mallopt(int, int);
#endif /* MSPACES */ #endif /* MSPACES */
#ifdef __cplusplus #ifdef __cplusplus
}; /* end of extern "C" */ } /* end of extern "C" */
#endif /* __cplusplus */ #endif /* __cplusplus */
/* /*

View File

@ -432,7 +432,8 @@ std::string mpreal::toString(const std::string& format) const
std::string mpreal::toString(int n, int b, mp_rnd_t mode) const std::string mpreal::toString(int n, int b, mp_rnd_t mode) const
{ {
(void)b;
(void)mode;
#if (MPFR_VERSION >= MPFR_VERSION_NUM(2,4,0)) #if (MPFR_VERSION >= MPFR_VERSION_NUM(2,4,0))
// Use MPFR native function for output // Use MPFR native function for output

View File

@ -538,7 +538,7 @@ private:
// //
// at the beginning of // at the beginning of
// [Visual Studio Installation Folder]\Common7\Packages\Debugger\autoexp.dat // [Visual Studio Installation Folder]\Common7\Packages\Debugger\autoexp.dat
MPREAL_MSVC_DEBUGVIEW_DATA; MPREAL_MSVC_DEBUGVIEW_DATA
}; };
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
@ -689,8 +689,8 @@ inline int bits2digits(mp_prec_t b);
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// min, max // min, max
const mpreal max(const mpreal& x, const mpreal& y); const mpreal (max)(const mpreal& x, const mpreal& y);
const mpreal min(const mpreal& x, const mpreal& y); const mpreal (min)(const mpreal& x, const mpreal& y);
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// Implementation // Implementation
@ -1557,7 +1557,7 @@ inline bool isEqualUlps(const mpreal& a, const mpreal& b, int maxUlps)
/* /*
maxUlps - a and b can be apart by maxUlps binary numbers. maxUlps - a and b can be apart by maxUlps binary numbers.
*/ */
return abs(a - b) <= machine_epsilon(max(abs(a), abs(b))) * maxUlps; return abs(a - b) <= machine_epsilon((max)(abs(a), abs(b))) * maxUlps;
} }
inline bool isEqualFuzzy(const mpreal& a, const mpreal& b, const mpreal& eps) inline bool isEqualFuzzy(const mpreal& a, const mpreal& b, const mpreal& eps)