From 603375697b7ac62c9d306dbe3dbbea92f3202d09 Mon Sep 17 00:00:00 2001 From: hniksic Date: Fri, 8 Apr 2005 15:05:45 -0700 Subject: [PATCH] [svn] Use Windows timers under Cygwin. --- src/ChangeLog | 5 +++++ src/ptimer.c | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index aece8bee..0ae52593 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2005-04-08 Hrvoje Niksic + + * ptimer.c: Use Windows timers under Cygwin, whose POSIX timer + implementation is incomplete. + 2005-04-08 Hrvoje Niksic * ptimer.c (struct ptimer): Remove the unused initialized field. diff --git a/src/ptimer.c b/src/ptimer.c index 472e74ba..33ca728e 100644 --- a/src/ptimer.c +++ b/src/ptimer.c @@ -66,6 +66,13 @@ so, delete this exception statement from your version. */ #endif #include +/* Cygwin currently (as of 2005-04-08, Cygwin 1.5.14) lack clock_getres, + but still define _POSIX_TIMERS! Because of that we simply use the + Windows timers under Cygwin. */ +#ifdef __CYGWIN__ +# include +#endif + #include "wget.h" #include "ptimer.h" @@ -82,7 +89,7 @@ extern int errno; #undef PTIMER_TIME #undef PTIMER_WINDOWS -#ifdef WINDOWS +#if defined(WINDOWS) || defined(__CYGWIN__) # define PTIMER_WINDOWS /* use Windows timers */ #else # if _POSIX_TIMERS > 0