This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Rely on C89 <time.h>
authorAaron Crane <arc@cpan.org>
Fri, 13 Oct 2017 09:18:10 +0000 (11:18 +0200)
committerAaron Crane <arc@cpan.org>
Sat, 21 Oct 2017 15:52:50 +0000 (16:52 +0100)
The Configure script here was built from a metaconfig unit that also assumes
<time.h> exists.

Configure
config_h.SH
dist/IO/poll.c
perl.h
uconfig.h

index 49c9000..e7bf160 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -10830,16 +10830,15 @@ set $varname;
 eval $setvar;
 $rm_try'
 
-: see if we should include time.h, sys/time.h, or both
+: see if we should include sys/time.h
 echo " "
+i_time='define'
 if test "X$timeincl" = X; then
-       echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
+       echo "Testing to see if we should include <sys/time.h>." >&4
        $echo $n "I'm now running the test program...$c"
        $cat >try.c <<EOCP
 #include <sys/types.h>
-#ifdef I_TIME
 #include <time.h>
-#endif
 #ifdef I_SYSTIME
 #ifdef SYSTIMEKERNEL
 #define KERNEL
@@ -10876,13 +10875,12 @@ EOCP
        sysselect=''
        for s_timeval in '-DS_TIMEVAL' ''; do
        for i_systimek in '' '-DSYSTIMEKERNEL'; do
-       for i_time in '' '-DI_TIME'; do
        for i_systime in '-DI_SYSTIME' ''; do
                case "$flags" in
                '') $echo $n ".$c"
-                       set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
+                       set try $i_systime $i_systimek $sysselect $s_timeval $s_timezone
                        if eval $compile; then
-                               set X $i_time $i_systime $i_systimek $sysselect $s_timeval
+                               set X $i_systime $i_systimek $sysselect $s_timeval
                                shift
                                flags="$*"
                                echo " "
@@ -10894,7 +10892,6 @@ EOCP
        done
        done
        done
-       done
        timeincl=''
        echo " "
        case "$flags" in
@@ -10904,12 +10901,6 @@ EOCP
        *) i_systimek="$undef";;
        esac
        case "$flags" in
-       *I_TIME*) i_time="$define"
-               timeincl=`./findhdr time.h`" $timeincl"
-               echo "We'll include <time.h>." >&4;;
-       *) i_time="$undef";;
-       esac
-       case "$flags" in
        *I_SYSTIME*) i_systime="$define"
                timeincl=`./findhdr sys/time.h`" $timeincl"
                echo "We'll include <sys/time.h>." >&4;;
index 35b656f..aa0f911 100755 (executable)
@@ -1204,8 +1204,8 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un
 #define DOUBLESIZE $doublesize         /**/
 
 /* I_TIME:
- *     This symbol, if defined, indicates to the C program that it should
- *     include <time.h>.
+ *     This symbol is always defined, and indicates to the C program that
+ *     it should include <time.h>.
  */
 /* I_SYS_TIME:
  *     This symbol, if defined, indicates to the C program that it should
index 03f6604..344a406 100644 (file)
@@ -18,9 +18,7 @@
 #ifdef I_SYS_TIME
 # include <sys/time.h>
 #endif
-#ifdef I_TIME
-# include <time.h>
-#endif
+#include <time.h>
 #include <sys/types.h>
 #if defined(HAS_SOCKET) && !defined(VMS) && !defined(ultrix) /* VMS handles sockets via vmsish.h, ULTRIX dies of socket struct redefinitions */
 #  include <sys/socket.h>
diff --git a/perl.h b/perl.h
index 6f34934..f0281c2 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -1020,9 +1020,7 @@ EXTERN_C int usleep(unsigned int);
 #   undef S_ISLNK
 #endif
 
-#ifdef I_TIME
-#   include <time.h>
-#endif
+#include <time.h>
 
 #ifdef I_SYS_TIME
 #   ifdef I_SYS_TIME_KERNEL
index 770f706..50c1c95 100644 (file)
--- a/uconfig.h
+++ b/uconfig.h
 #define DOUBLESIZE 8           /**/
 
 /* I_TIME:
- *     This symbol, if defined, indicates to the C program that it should
- *     include <time.h>.
+ *     This symbol is always defined, and indicates to the C program that
+ *     it should include <time.h>.
  */
 /* I_SYS_TIME:
  *     This symbol, if defined, indicates to the C program that it should
 #endif
 
 /* Generated from:
- * 798105cde7e4037b267cd74a3ebf1895b212f333b5300ebdc1414825b2a210e1 config_h.SH
+ * ef59adc025306aceebb47a7515e514357b77e44a359af4bc0bf5d52082e41a26 config_h.SH
  * d40282b246b20f1f20a5febcae42b3ac44234c5a1c1a2df89e5ac77a54830cca uconfig.sh
  * ex: set ro: */