From 44cbb7cec710b1a8e24859816379d1bdc32fbfa6 Mon Sep 17 00:00:00 2001 From: Marko Kreen Date: Mon, 6 Sep 2010 08:17:29 +0300 Subject: [PATCH] time: win32 can have usleep --- m4/usual.m4 | 2 +- usual/time.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/m4/usual.m4 b/m4/usual.m4 index a8f94d5..dd61077 100644 --- a/m4/usual.m4 +++ b/m4/usual.m4 @@ -138,7 +138,7 @@ AC_CHECK_FUNCS(inet_ntop poll getline memrchr regcomp) AC_CHECK_FUNCS(err errx warn warnx getprogname setprogname) AC_CHECK_FUNCS(posix_memalign memalign valloc) ### Functions provided only on win32 -AC_CHECK_FUNCS(localtime_r recvmsg sendmsg) +AC_CHECK_FUNCS(localtime_r recvmsg sendmsg usleep) ### Functions used by libusual itself AC_CHECK_FUNCS(syslog mmap recvmsg sendmsg getpeerucred) ### win32: link with ws2_32 diff --git a/usual/time.h b/usual/time.h index 90b7212..21a33b7 100644 --- a/usual/time.h +++ b/usual/time.h @@ -38,7 +38,9 @@ void reset_time_cache(void); int gettimeofday(struct timeval * tp, void * tzp); struct tm *localtime_r(const time_t *tp, struct tm *buf); +#ifndef HAVE_USLEEP static inline void usleep(long usec) { Sleep(usec / 1000); } +#endif struct rusage { struct timeval ru_utime; -- 2.39.5