This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
U/compline/i_time.U: assume C89 <time.h> exists
authorAaron Crane <arc@cpan.org>
Fri, 13 Oct 2017 09:16:17 +0000 (11:16 +0200)
committerAaron Crane <arc@cpan.org>
Sat, 21 Oct 2017 15:45:08 +0000 (16:45 +0100)
U/compline/i_time.U

index 21231f5..2b14851 100644 (file)
@@ -22,7 +22,7 @@
        contains rm_try echo n c +i_sysselct Findhdr Hasfield i_stdlib
 ?MAKE: -pick add $@ %<
 ?S:i_time:
-?S:    This variable conditionally defines I_TIME, which indicates
+?S:    This variable unconditionally defines I_TIME, which indicates
 ?S:    to the C program that it should include <time.h>.
 ?S:.
 ?S:i_systime:
@@ -46,8 +46,8 @@
 ?S:    indicates to the C program that the struct tm has the tm_gmtoff field.
 ?S:.
 ?C:I_TIME (USE_TIME_H):
-?C:    This symbol, if defined, indicates to the C program that it should
-?C:    include <time.h>.
+?C:    This symbol is always defined, and indicates to the C program that
+?C:    it should include <time.h>.
 ?C:.
 ?C:I_SYS_TIME (I_SYSTIME USE_SYS_TIME_H NO_TIME_WITH_SYS_TIME):
 ?C:    This symbol, if defined, indicates to the C program that it should
 ?LINT:change i_sysselct
 ?LINT:set d_tm_tm_zone
 ?LINT:set d_tm_tm_gmtoff
-: 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
@@ -138,13 +137,12 @@ EOCP
 @end
        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 " "
@@ -155,7 +153,6 @@ EOCP
        done
        done
        done
-       done
 @if I_SYSSELECT
        done
 @end
@@ -171,12 +168,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;;