From 363b51dfb7445d41b7a8c622f61d64736ce82eb4 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 29 Apr 2010 11:09:39 +0200 Subject: [PATCH 1/1] Forward decl timeval. Include sys/time.h in source --- include/yaz/gettimeofday.h | 3 ++- include/yaz/mutex.h | 4 ++-- src/gettimeofday.c | 4 +++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/include/yaz/gettimeofday.h b/include/yaz/gettimeofday.h index f7b0c68..73014e8 100644 --- a/include/yaz/gettimeofday.h +++ b/include/yaz/gettimeofday.h @@ -32,11 +32,12 @@ #ifndef YAZ_GETTIMEOFDAY_H #define YAZ_GETTIMEOFDAY_H -#include #include YAZ_BEGIN_CDECL +YAZ_EXPORT struct timeval; + /** \brief gettimeofday \param tval timeval for resulting time diff --git a/include/yaz/mutex.h b/include/yaz/mutex.h index dab2f13..4f21521 100644 --- a/include/yaz/mutex.h +++ b/include/yaz/mutex.h @@ -103,6 +103,8 @@ YAZ_EXPORT void yaz_cond_create(YAZ_COND *p); YAZ_EXPORT void yaz_cond_destroy(YAZ_COND *p); +YAZ_EXPORT struct timeval; + /** \brief waits for condition \param p condition variable handle \param m mutex @@ -110,8 +112,6 @@ void yaz_cond_destroy(YAZ_COND *p); Semantics like pthread_cond_wait. */ -YAZ_EXPORT struct timeval; - YAZ_EXPORT int yaz_cond_wait(YAZ_COND p, YAZ_MUTEX m, const struct timeval *abstime); diff --git a/src/gettimeofday.c b/src/gettimeofday.c index c14c36e..2310920 100644 --- a/src/gettimeofday.c +++ b/src/gettimeofday.c @@ -20,7 +20,9 @@ #include #include #endif -#include +#if HAVE_SYS_TIME_H +#include +#endif #include int yaz_gettimeofday(struct timeval *tval) -- 1.7.10.4