]> sjero.net Git - wget/blobdiff - src/ptimer.c
[svn] Typo fix in comment.
[wget] / src / ptimer.c
index 472e74ba395064e4b659161f3c0e295944886e1a..ebfdf5a09779f11338c1498e63dd353ca2bbdc76 100644 (file)
@@ -66,6 +66,13 @@ so, delete this exception statement from your version.  */
 #endif
 #include <assert.h>
 
+/* Cygwin currently (as of 2005-04-08, Cygwin 1.5.14) lacks clock_getres,
+   but still defines _POSIX_TIMERS!  Because of that we simply use the
+   Windows timers under Cygwin.  */
+#ifdef __CYGWIN__
+# include <windows.h>
+#endif
+
 #include "wget.h"
 #include "ptimer.h"
 
@@ -82,10 +89,10 @@ 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
+# if _POSIX_TIMERS - 0 > 0
 #  define PTIMER_POSIX         /* use POSIX timers (clock_gettime) */
 # else
 #  ifdef HAVE_GETTIMEOFDAY
@@ -132,7 +139,7 @@ posix_init (void)
     int id;
     int sysconf_name;
   } clocks[] = {
-#if defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0
+#if defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK - 0 >= 0
     { CLOCK_MONOTONIC, _SC_MONOTONIC_CLOCK },
 #endif
 #ifdef CLOCK_HIGHRES