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) */