summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Trangez <ikke@nicolast.be>2022-09-21 13:49:58 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-10-21 02:58:39 -0400
commita2af7c4c59ef24a71cc6cab7bd6b07d12f02aad1 (patch)
tree08e881fc1d61ca41c5f9297cbcb0b2bbb545c181
parent8cd6f435e60f9dd14ad55a0002ff833536e9ccb2 (diff)
downloadhaskell-a2af7c4c59ef24a71cc6cab7bd6b07d12f02aad1.tar.gz
build: get rid of `HAVE_TIME_H`
As advertized by `autoreconf`: > All current systems provide time.h; it need not be checked for. Hence, remove the check for it in `configure.ac` and remove conditional inclusion of the header in `HAVE_TIME_H` blocks where applicable. The `time.h` header was being included in various source files without a `HAVE_TIME_H` guard already anyway.
-rw-r--r--configure.ac2
-rw-r--r--libraries/base/System/CPUTime/Posix/ClockGetTime.hsc2
-rw-r--r--libraries/base/aclocal.m44
-rw-r--r--libraries/base/cbits/sysconf.c2
-rw-r--r--libraries/base/include/HsBase.h2
-rw-r--r--m4/fp_check_timer_create.m42
-rw-r--r--rts/RtsUtils.c2
-rw-r--r--rts/posix/Clock.h4
-rw-r--r--rts/win32/GetTime.c4
9 files changed, 4 insertions, 20 deletions
diff --git a/configure.ac b/configure.ac
index 5f0a812e48..0f8e0ba4b4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -845,7 +845,7 @@ dnl off_t, because it will affect the result of that test.
AC_SYS_LARGEFILE
dnl ** check for specific header (.h) files that we are interested in
-AC_CHECK_HEADERS([ctype.h dirent.h dlfcn.h errno.h fcntl.h grp.h limits.h locale.h nlist.h pthread.h pwd.h signal.h sys/param.h sys/mman.h sys/resource.h sys/select.h sys/time.h sys/timeb.h sys/timerfd.h sys/timers.h sys/times.h sys/utsname.h sys/wait.h termios.h time.h utime.h windows.h winsock.h sched.h])
+AC_CHECK_HEADERS([ctype.h dirent.h dlfcn.h errno.h fcntl.h grp.h limits.h locale.h nlist.h pthread.h pwd.h signal.h sys/param.h sys/mman.h sys/resource.h sys/select.h sys/time.h sys/timeb.h sys/timerfd.h sys/timers.h sys/times.h sys/utsname.h sys/wait.h termios.h utime.h windows.h winsock.h sched.h])
dnl sys/cpuset.h needs sys/param.h to be included first on FreeBSD 9.1; #7708
AC_CHECK_HEADERS([sys/cpuset.h], [], [],
diff --git a/libraries/base/System/CPUTime/Posix/ClockGetTime.hsc b/libraries/base/System/CPUTime/Posix/ClockGetTime.hsc
index f24dec3b14..259cee8226 100644
--- a/libraries/base/System/CPUTime/Posix/ClockGetTime.hsc
+++ b/libraries/base/System/CPUTime/Posix/ClockGetTime.hsc
@@ -2,10 +2,8 @@
#include "HsFFI.h"
#include "HsBaseConfig.h"
-#if HAVE_TIME_H
#include <unistd.h>
#include <time.h>
-#endif
module System.CPUTime.Posix.ClockGetTime
( getCPUTime
diff --git a/libraries/base/aclocal.m4 b/libraries/base/aclocal.m4
index 083a427fc7..da1ee301ec 100644
--- a/libraries/base/aclocal.m4
+++ b/libraries/base/aclocal.m4
@@ -78,9 +78,7 @@ AC_DEFUN([FPTOOLS_HTYPE_INCLUDES],
# include <signal.h>
#endif
-#if HAVE_TIME_H
-# include <time.h>
-#endif
+#include <time.h>
#if HAVE_TERMIOS_H
# include <termios.h>
diff --git a/libraries/base/cbits/sysconf.c b/libraries/base/cbits/sysconf.c
index bbf785326a..1bce685296 100644
--- a/libraries/base/cbits/sysconf.c
+++ b/libraries/base/cbits/sysconf.c
@@ -6,9 +6,7 @@
#endif
/* for CLK_TCK */
-#if HAVE_TIME_H
#include <time.h>
-#endif
long clk_tck(void) {
#if defined(CLK_TCK)
diff --git a/libraries/base/include/HsBase.h b/libraries/base/include/HsBase.h
index 1880f28d86..d55ec0747a 100644
--- a/libraries/base/include/HsBase.h
+++ b/libraries/base/include/HsBase.h
@@ -74,9 +74,7 @@
# include <sys/timers.h>
# endif
#endif
-#if HAVE_TIME_H
#include <time.h>
-#endif
#if HAVE_SYS_TIMEB_H && !defined(__FreeBSD__)
#include <sys/timeb.h>
#endif
diff --git a/m4/fp_check_timer_create.m4 b/m4/fp_check_timer_create.m4
index e698885065..957772ba45 100644
--- a/m4/fp_check_timer_create.m4
+++ b/m4/fp_check_timer_create.m4
@@ -20,9 +20,7 @@ then
#if defined(HAVE_STDLIB_H)
#include <stdlib.h>
#endif
-#if defined(HAVE_TIME_H)
#include <time.h>
-#endif
#if defined(HAVE_SIGNAL_H)
#include <signal.h>
#endif
diff --git a/rts/RtsUtils.c b/rts/RtsUtils.c
index 3878a40697..2017884e48 100644
--- a/rts/RtsUtils.c
+++ b/rts/RtsUtils.c
@@ -15,9 +15,7 @@
#include "Schedule.h"
#include "RtsFlags.h"
-#if defined(HAVE_TIME_H)
#include <time.h>
-#endif
/* HACK: On Mac OS X 10.4 (at least), time.h doesn't declare ctime_r with
* _POSIX_C_SOURCE. If this is the case, we declare it ourselves.
diff --git a/rts/posix/Clock.h b/rts/posix/Clock.h
index 92d0581877..2476454c3e 100644
--- a/rts/posix/Clock.h
+++ b/rts/posix/Clock.h
@@ -12,9 +12,7 @@
# include <unistd.h>
#endif
-#if defined(HAVE_TIME_H)
-# include <time.h>
-#endif
+#include <time.h>
#if defined(HAVE_SYS_TIME_H)
# include <sys/time.h>
diff --git a/rts/win32/GetTime.c b/rts/win32/GetTime.c
index e0f5e7d406..1722e14f8f 100644
--- a/rts/win32/GetTime.c
+++ b/rts/win32/GetTime.c
@@ -11,9 +11,7 @@
#include <windows.h>
-#if defined(HAVE_TIME_H)
-# include <time.h>
-#endif
+#include <time.h>
/* Convert FILETIMEs into secs */