From f766d90704b03cbe277e3fd4b4153d892960f135 Mon Sep 17 00:00:00 2001 From: Mike Gerdts Date: Fri, 16 Feb 2018 22:34:41 +0000 Subject: [PATCH 1/2] Fixed building on SmartOS timeradd is missing on Solaris 10, but is present as a macro in on SmartOS, illumos, and likely Solaris 11. --- psycopg/solaris_support.c | 5 ++++- psycopg/solaris_support.h | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/psycopg/solaris_support.c b/psycopg/solaris_support.c index cf82e2ed..e5f8edf6 100644 --- a/psycopg/solaris_support.c +++ b/psycopg/solaris_support.c @@ -1,6 +1,7 @@ /* solaris_support.c - emulate functions missing on Solaris * * Copyright (C) 2017 My Karlsson + * Copyright (c) 2018, Joyent, Inc. * * This file is part of psycopg. * @@ -28,7 +29,8 @@ #include "psycopg/solaris_support.h" #if defined(__sun) && defined(__SVR4) -/* timeradd is missing on Solaris */ +/* timeradd is missing on Solaris 10 */ +#ifndef timeradd void timeradd(struct timeval *a, struct timeval *b, struct timeval *c) { @@ -51,4 +53,5 @@ timersub(struct timeval *a, struct timeval *b, struct timeval *c) c->tv_sec -= 1; } } +#endif /* timeradd */ #endif /* defined(__sun) && defined(__SVR4) */ diff --git a/psycopg/solaris_support.h b/psycopg/solaris_support.h index 33c2f2b8..880e9f18 100644 --- a/psycopg/solaris_support.h +++ b/psycopg/solaris_support.h @@ -1,6 +1,7 @@ /* solaris_support.h - definitions for solaris_support.c * * Copyright (C) 2017 My Karlsson + * Copyright (c) 2018, Joyent, Inc. * * This file is part of psycopg. * @@ -30,8 +31,10 @@ #if defined(__sun) && defined(__SVR4) #include +#ifndef timeradd extern HIDDEN void timeradd(struct timeval *a, struct timeval *b, struct timeval *c); extern HIDDEN void timersub(struct timeval *a, struct timeval *b, struct timeval *c); #endif +#endif #endif /* !defined(PSYCOPG_SOLARIS_SUPPORT_H) */ From 8670287928501edf0d3868cf468a6796ad841b50 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Mon, 19 Feb 2018 11:43:37 +0000 Subject: [PATCH 2/2] Added Solaris 11 fix to news file --- NEWS | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/NEWS b/NEWS index c400f249..dfee39c9 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,13 @@ Other changes: without using 2to3. +What's new in psycopg 2.7.5 +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- Fixed building on Solaris 11 and derivatives such as SmartOS and illumos + (:ticket:`#677`) + + What's new in psycopg 2.7.4 ^^^^^^^^^^^^^^^^^^^^^^^^^^^