Forward decl timeval. Include sys/time.h in source
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 29 Apr 2010 09:09:39 +0000 (11:09 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 29 Apr 2010 09:09:39 +0000 (11:09 +0200)
include/yaz/gettimeofday.h
include/yaz/mutex.h
src/gettimeofday.c

index f7b0c68..73014e8 100644 (file)
 #ifndef YAZ_GETTIMEOFDAY_H
 #define YAZ_GETTIMEOFDAY_H
 
-#include <time.h>
 #include <yaz/yconfig.h>
 
 YAZ_BEGIN_CDECL
 
+YAZ_EXPORT struct timeval;
+
 /** \brief gettimeofday
     \param tval timeval for resulting time
 
index dab2f13..4f21521 100644 (file)
@@ -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);
 
index c14c36e..2310920 100644 (file)
@@ -20,7 +20,9 @@
 #include <windows.h>
 #include <sys/timeb.h>
 #endif
-#include <time.h>
+#if HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
 #include <yaz/gettimeofday.h>
 
 int yaz_gettimeofday(struct timeval *tval)