From 32cec09d136060e02dfa28d65f2cb19028706652 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Tue, 9 Apr 2013 21:58:30 +0200 Subject: [PATCH] simplify configure checks for functionality provided by gnulib * configure.ac: Remove checks for pipe, stftime, times, and select, as our Gnulib modules already ensure they are provided. * libguile/stime.c: Rely on gnulib providing `times'. --- configure.ac | 10 ++++------ libguile/stime.c | 21 --------------------- 2 files changed, 4 insertions(+), 27 deletions(-) diff --git a/configure.ac b/configure.ac index 1ba6f3d81..d6cc2eb9a 100644 --- a/configure.ac +++ b/configure.ac @@ -734,8 +734,6 @@ AC_CHECK_HEADERS([assert.h crt_externs.h]) # has it as an inline for chsize) # ioctl - not in mingw. # gmtime_r - recent posix, not on old systems -# pipe - not in mingw -# _pipe - specific to mingw, taking 3 args # readdir_r - recent posix, not on old systems # readdir64_r - not available on HP-UX 11.11 # stat64 - SuS largefile stuff, not on old systems @@ -751,10 +749,10 @@ AC_CHECK_HEADERS([assert.h crt_externs.h]) # AC_CHECK_FUNCS([DINFINITY DQNAN cexp chsize clog clog10 ctermid \ fesetround ftime ftruncate fchown fchmod getcwd geteuid getsid \ - gettimeofday gmtime_r ioctl lstat mkdir mknod nice pipe _pipe \ - readdir_r readdir64_r readlink rename rmdir select setegid seteuid \ - setlocale setpgid setsid sigaction siginterrupt stat64 strftime \ - strptime symlink sync sysconf tcgetpgrp tcsetpgrp times uname waitpid \ + gettimeofday gmtime_r ioctl lstat mkdir mknod nice \ + readdir_r readdir64_r readlink rename rmdir setegid seteuid \ + setlocale setpgid setsid sigaction siginterrupt stat64 \ + strptime symlink sync sysconf tcgetpgrp tcsetpgrp uname waitpid \ strdup system usleep atexit on_exit chown link fcntl ttyname getpwent \ getgrent kill getppid getpgrp fork setitimer getitimer strchr strcmp \ index bcopy memcpy rindex truncate unsetenv isblank _NSGetEnviron \ diff --git a/libguile/stime.c b/libguile/stime.c index 90de697e5..4e1f25c13 100644 --- a/libguile/stime.c +++ b/libguile/stime.c @@ -170,7 +170,6 @@ get_internal_real_time_gettimeofday (void) #endif -#if defined HAVE_TIMES static long ticks_per_second; static long @@ -181,15 +180,6 @@ get_internal_run_time_times (void) return (time_buffer.tms_utime + time_buffer.tms_stime) * TIME_UNITS_PER_SECOND / ticks_per_second; } -#endif - -static timet fallback_real_time_base; -static long -get_internal_real_time_fallback (void) -{ - return time_from_seconds_and_nanoseconds - ((long) time (NULL) - fallback_real_time_base, 0); -} SCM_DEFINE (scm_get_internal_real_time, "get-internal-real-time", 0, 0, 0, @@ -203,7 +193,6 @@ SCM_DEFINE (scm_get_internal_real_time, "get-internal-real-time", 0, 0, 0, #undef FUNC_NAME -#ifdef HAVE_TIMES SCM_DEFINE (scm_times, "times", 0, 0, 0, (void), "Return an object with information about real and processor\n" @@ -254,7 +243,6 @@ SCM_DEFINE (scm_times, "times", 0, 0, 0, return result; } #undef FUNC_NAME -#endif /* HAVE_TIMES */ long scm_c_get_internal_run_time (void) @@ -869,7 +857,6 @@ scm_init_stime() /* Init ticks_per_second for scm_times, and use times(2)-based run-time timer if needed. */ -#ifdef HAVE_TIMES #ifdef _SC_CLK_TCK ticks_per_second = sysconf (_SC_CLK_TCK); #else @@ -877,14 +864,6 @@ scm_init_stime() #endif if (!get_internal_run_time) get_internal_run_time = get_internal_run_time_times; -#endif - - if (!get_internal_real_time) - /* No POSIX timers, gettimeofday doesn't work... badness! */ - { - fallback_real_time_base = time (NULL); - get_internal_real_time = get_internal_real_time_fallback; - } /* If we don't have a run-time timer, use real-time. */ if (!get_internal_run_time)