From cda0b6a8eb68c50cccd03ecc83da5f990b2e274b 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 558f7ad9291b66cdb43486fecf4c5a909c494ff9 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 e335eb98ce58e9b474c96972ff4e777ceba006c2 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 fdc5dc750c7003da226132195dcfa832bc16a512 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 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/NEWS b/NEWS index ca013f1b..a12f8b4f 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,10 @@ +What's new in psycopg 2.5.1 +--------------------------- + +- Fixed build on Solaris 10 and 11 where the round() function is already + declared (:ticket:`#146`). + + What's new in psycopg 2.5 -------------------------