From eafcc650c8834ab6708675b2466f1a53bcb706c6 Mon Sep 17 00:00:00 2001 From: Daniel Enman Date: Thu, 18 Apr 2013 16:59:26 -0300 Subject: [PATCH 1/4] Solaris 10+, and illumos distros have round() --- psycopg/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/psycopg/config.h b/psycopg/config.h index f3094493..8b8a4499 100644 --- a/psycopg/config.h +++ b/psycopg/config.h @@ -141,7 +141,7 @@ static int pthread_mutex_init(pthread_mutex_t *mutex, void* fake) #endif #endif -#if (defined(__FreeBSD__) && __FreeBSD_version < 503000) || (defined(_WIN32) && !defined(__GNUC__)) || defined(__sun__) || defined(sun) +#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? */ static double round(double num) { From 5eefec4f5ebd5ceb7fd2b1e89b68e8f039dec0c2 Mon Sep 17 00:00:00 2001 From: Daniel Enman Date: Thu, 18 Apr 2013 17:12:14 -0300 Subject: [PATCH 2/4] Remove extra || --- psycopg/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/psycopg/config.h b/psycopg/config.h index 8b8a4499..645f6dba 100644 --- a/psycopg/config.h +++ b/psycopg/config.h @@ -141,7 +141,7 @@ static int pthread_mutex_init(pthread_mutex_t *mutex, void* fake) #endif #endif -#if (defined(__FreeBSD__) && __FreeBSD_version < 503000) || (defined(_WIN32) && !defined(__GNUC__)) || || (defined(sun) || defined(__sun__)) && (defined(__SunOS_5_8) || defined(__SunOS_5_9)) +#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? */ static double round(double num) { From 0973d02b4bd8153f8ea6dd2264f455c2919d8a1f Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Sat, 20 Apr 2013 02:21:58 +0100 Subject: [PATCH 3/4] Long ifdef reformatted for readibility --- psycopg/config.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/psycopg/config.h b/psycopg/config.h index 645f6dba..45157709 100644 --- a/psycopg/config.h +++ b/psycopg/config.h @@ -141,7 +141,10 @@ static int pthread_mutex_init(pthread_mutex_t *mutex, void* fake) #endif #endif -#if (defined(__FreeBSD__) && __FreeBSD_version < 503000) || (defined(_WIN32) && !defined(__GNUC__)) || (defined(sun) || defined(__sun__)) && (defined(__SunOS_5_8) || defined(__SunOS_5_9)) +#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? */ static double round(double num) { From 75947a6fefb5299578490b189b7efbf05f50ab99 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Sat, 20 Apr 2013 02:31:31 +0100 Subject: [PATCH 4/4] Mention Solaris round fix in NEWS file --- NEWS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS b/NEWS index 4f730a65..46121cd7 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,8 @@ What's new in psycopg 2.4.7 --------------------------- - Properly cleanup memory of broken connections (ticket #142). + - Fixed build on Solaris 10 and 11 where the round() function is already + declared (:ticket:`#146`). - Fixed bad interaction of setup.py with other dependencies in Distribute project on Python 3 (ticket #153).