From: Adam Dickmeiss Date: Thu, 29 Apr 2010 09:09:39 +0000 (+0200) Subject: Forward decl timeval. Include sys/time.h in source X-Git-Tag: v4.0.6~6 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=363b51dfb7445d41b7a8c622f61d64736ce82eb4;hp=fe8b76d75847dfc7f9dac3d1382c2eb0ab28dec0 Forward decl timeval. Include sys/time.h in source --- 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)