]> sjero.net Git - wget/blobdiff - src/ptimer.c
[svn] Remove K&R support.
[wget] / src / ptimer.c
index 3a09ceba760ad0010332d569b0a6466eae04d940..695019e9389079c497484486b3d8cda294532dea 100644 (file)
@@ -54,20 +54,16 @@ so, delete this exception statement from your version.  */
 
 #include <stdio.h>
 #include <stdlib.h>
-#ifdef HAVE_STRING_H
-# include <string.h>
-#else  /* not HAVE_STRING_H */
-# include <strings.h>
-#endif /* not HAVE_STRING_H */
-#include <sys/types.h>
+#include <string.h>
 #include <errno.h>
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
 #include <assert.h>
+#include <time.h>
 
-/* 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
+/* 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>
@@ -76,10 +72,6 @@ so, delete this exception statement from your version.  */
 #include "wget.h"
 #include "ptimer.h"
 
-#ifndef errno
-extern int errno;
-#endif
-
 /* Depending on the OS and availability of gettimeofday(), one and
    only one of PTIMER_POSIX, PTIMER_GETTIMEOFDAY, PTIMER_WINDOWS, or
    PTIMER_TIME will be defined.  */
@@ -92,7 +84,7 @@ extern int errno;
 #if defined(WINDOWS) || defined(__CYGWIN__)
 # define PTIMER_WINDOWS                /* use Windows timers */
 #else
-# if defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0
+# if _POSIX_TIMERS - 0 > 0
 #  define PTIMER_POSIX         /* use POSIX timers (clock_gettime) */
 # else
 #  ifdef HAVE_GETTIMEOFDAY
@@ -139,7 +131,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