mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-22 17:06:33 +03:00
Fix for MSVC 2015: round has been added to this version
This commit is contained in:
parent
ac25ba0a3f
commit
71925fcc00
|
@ -142,16 +142,20 @@ static int pthread_mutex_init(pthread_mutex_t *mutex, void* fake)
|
|||
#endif
|
||||
#endif
|
||||
|
||||
/* what's this, we have no round function either? */
|
||||
#if (defined(__FreeBSD__) && __FreeBSD_version < 503000) \
|
||||
|| (defined(_WIN32) && !defined(__GNUC__)) \
|
||||
|| (defined(sun) || defined(__sun__)) \
|
||||
&& (defined(__SunOS_5_8) || defined(__SunOS_5_9))
|
||||
/* what's this, we have no round function either? */
|
||||
|
||||
/* round has been added in the standard library with MSVC 2015 */
|
||||
#if _MSC_VER < 1900
|
||||
static double round(double num)
|
||||
{
|
||||
return (num >= 0) ? floor(num + 0.5) : ceil(num - 0.5);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* resolve missing isinf() function for Solaris */
|
||||
#if defined (__SVR4) && defined (__sun)
|
||||
|
|
Loading…
Reference in New Issue
Block a user