changeset 10073:dcde57cb5778

use times module from gnulib
author John W. Eaton <jwe@octave.org>
date Thu, 07 Jan 2010 17:26:18 -0500
parents 0b0bf1fd1ed7
children 5e2b4b7967cc
files ChangeLog bootstrap.conf configure.ac src/ChangeLog src/data.cc
diffstat 5 files changed, 11 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Jan 07 16:43:48 2010 -0500
+++ b/ChangeLog	Thu Jan 07 17:26:18 2010 -0500
@@ -1,3 +1,8 @@
+2010-01-07  John W. Eaton  <jwe@octave.org>
+
+	* configure.ac: Don't check for times.
+	* bootstrap.conf (gnulib_modules): Include times in the list.
+
 2010-01-07  John W. Eaton  <jwe@octave.org>
 
 	* configure.ac: Don't check for gettimeofday, or whether
--- a/bootstrap.conf	Thu Jan 07 16:43:48 2010 -0500
+++ b/bootstrap.conf	Thu Jan 07 17:26:18 2010 -0500
@@ -27,6 +27,7 @@
   mkfifo
   stat
   strftime
+  times
 "
 
 # Additional xgettext options to use.  Use "\\\newline" to break lines.
--- a/configure.ac	Thu Jan 07 16:43:48 2010 -0500
+++ b/configure.ac	Thu Jan 07 17:26:18 2010 -0500
@@ -1677,7 +1677,7 @@
 
 ### A system dependent kluge or two.
 
-AC_CHECK_FUNCS(getrusage times)
+AC_CHECK_FUNCS(getrusage)
 case "$canonical_host_type" in
   *-*-cygwin*)
     AC_DEFINE(RUSAGE_TIMES_ONLY, 1, [Define if your struct rusage only has time information.])
--- a/src/ChangeLog	Thu Jan 07 16:43:48 2010 -0500
+++ b/src/ChangeLog	Thu Jan 07 17:26:18 2010 -0500
@@ -1,3 +1,7 @@
+2010-01-07  John W. Eaton  <jwe@octave.org>
+
+	* data.cc (cputime): Eliminate Windows-specific code.
+
 2010-01-07  John W. Eaton  <jwe@octave.org>
 
 	* variables.cc (get_global_value): Fix function name in error message.
--- a/src/data.cc	Thu Jan 07 16:43:48 2010 -0500
+++ b/src/data.cc	Thu Jan 07 17:26:18 2010 -0500
@@ -5700,18 +5700,6 @@
   sys = static_cast<double> (seconds) + static_cast<double>(fraction) /
     static_cast<double>(HZ);
 
-#elif defined (__WIN32__)
-
-  HANDLE hProcess = GetCurrentProcess ();
-  FILETIME ftCreation, ftExit, ftUser, ftKernel;
-  GetProcessTimes (hProcess, &ftCreation, &ftExit, &ftKernel, &ftUser);
-
-  int64_t itmp = *(reinterpret_cast<int64_t *> (&ftUser));
-  usr = static_cast<double> (itmp) * 1e-7;
-
-  itmp = *(reinterpret_cast<int64_t *> (&ftKernel));
-  sys = static_cast<double> (itmp) * 1e-7;
-
 #endif
 
   retval (2) = sys;