From 8bfefed3b0871b5afb90a3cae95bb5011df3b5ee Mon Sep 17 00:00:00 2001
From: Martin Nilsson <nilsson@opera.com>
Date: Thu, 4 Sep 2014 00:52:12 +0200
Subject: [PATCH] clock is C89, so assume it exists.

---
 src/configure.in |  1 -
 src/rusage.c     | 18 ------------------
 src/threads.c    |  5 ++---
 3 files changed, 2 insertions(+), 22 deletions(-)

diff --git a/src/configure.in b/src/configure.in
index 870aa40eda..422689804b 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -4524,7 +4524,6 @@ fi
 AC_CHECK_FUNCS( \
  _crypt \
  poll \
- clock \
  closefrom \
  crypt \
  fdwalk \
diff --git a/src/rusage.c b/src/rusage.c
index c06958910f..d0e8b873ed 100644
--- a/src/rusage.c
+++ b/src/rusage.c
@@ -305,7 +305,6 @@ PMOD_EXPORT int pike_get_rusage(pike_rusage_t rusage_values)
 }
 
 #else /*HAVE_TIMES */
-#if defined(HAVE_CLOCK)
 
 #ifndef CLOCKS_PER_SEC
 #define CLOCKS_PER_SEC	1000000
@@ -318,23 +317,6 @@ PMOD_EXPORT int pike_get_rusage(pike_rusage_t rusage_values)
   return 1;
 }
 
-#else /* HAVE_CLOCK */
-
-PMOD_EXPORT int pike_get_rusage(pike_rusage_t rusage_values)
-{
-  /* This is totally wrong, but hey, if you can't do it _right_... */
-  struct timeval tm;
-  memset(rusage_values, 0, sizeof(pike_rusage_t));
-#ifndef CONFIGURE_TEST
-  ACCURATE_GETTIMEOFDAY(&tm);
-#else
-  GETTIMEOFDAY(&tm);
-#endif
-  rusage_values[0]=tm.tv_sec*1000L + tm.tv_usec/1000;
-  return 1;
-}
-
-#endif /* HAVE_CLOCK */
 #endif /* HAVE_TIMES */
 #endif /* HAVE_GETRUSAGE */
 #endif /* GETRUSAGE_THROUGH_PROCFS */
diff --git a/src/threads.c b/src/threads.c
index 41c7c81cd9..6f82eebf16 100644
--- a/src/threads.c
+++ b/src/threads.c
@@ -360,10 +360,9 @@ static void cleanup_thread_state (struct thread_state *th);
 
 #ifndef CONFIGURE_TEST
 
-#if defined(HAVE_CLOCK) &&						\
-    (defined (RDTSC) ||							\
+#if defined (RDTSC) ||							\
      (!defined(HAVE_GETHRTIME) &&					\
-      !(defined(HAVE_MACH_TASK_INFO_H) && defined(TASK_THREAD_TIMES_INFO))))
+      !(defined(HAVE_MACH_TASK_INFO_H) && defined(TASK_THREAD_TIMES_INFO)))
 static clock_t thread_start_clock = 0;
 static THREAD_T last_clocked_thread = 0;
 #define USE_CLOCK_FOR_SLICES
-- 
GitLab