Change 34105 by [EMAIL PROTECTED] on 2008/07/07 20:03:00

        Part one of y2038 changes for Schwern

Affected files ...

... //depot/perl/Configure#695 edit
... //depot/perl/Porting/Glossary#191 edit
... //depot/perl/config_h.SH#347 edit
... //depot/perl/handy.h#140 edit

Differences ...

==== //depot/perl/Configure#695 (xtext) ====
Index: perl/Configure
--- perl/Configure#694~34064~   2008-06-16 07:49:04.000000000 -0700
+++ perl/Configure      2008-07-07 13:03:00.000000000 -0700
@@ -25,7 +25,7 @@
 
 # $Id: Head.U 6 2006-08-25 22:21:46Z rmanfredi $
 #
-# Generated on Mon Jun 16 16:07:02 CEST 2008 [metaconfig 3.5 PL0]
+# Generated on Mon Jul  7 21:59:59 CEST 2008 [metaconfig 3.5 PL0]
 # (with additional metaconfig patches by [EMAIL PROTECTED])
 
 cat >c1$$ <<EOF
@@ -1171,6 +1171,8 @@
 d_stdio_stream_array=''
 stdio_stream_array=''
 sysman=''
+sGMTIME_max=''
+sGMTIME_min=''
 trnl=''
 uidformat=''
 uidsign=''
@@ -20001,6 +20003,77 @@
 fi
 $rm -f foo* bar*
 
+: Check the max offset that gmtime accepts
+echo "Checking max offset that gmtime () accepts"
+
+$cat >try.c <<'EOCP'
+#include <sys/types.h>
+#include <stdio.h>
+#include <time.h>
+int main () {
+  struct tm *tmp;
+  int i, y = 0;
+  time_t pt = 0;
+
+  for (i = 0; i < 78; i++) {
+    time_t t = (1 << i) - 1;
+    tmp = gmtime (&t);
+    if (tmp == NULL || tmp->tm_year < y) {
+      i--;
+      printf ("%d\n", pt);
+      return (i);
+      }
+
+    y = tmp->tm_year;
+    pt = t;
+    }
+  printf ("%d\n", pt);
+  return (0);
+  }
+EOCP
+set try
+if eval $compile; then
+    sGMTIME_max=`$run ./try`
+else
+    echo "Cannot determine sGMTIME_max"
+    fi
+$rm_try
+
+echo "Checking min offset that gmtime () accepts"
+
+$cat >try.c <<'EOCP'
+#include <sys/types.h>
+#include <stdio.h>
+#include <time.h>
+int main () {
+  struct tm *tmp;
+  int i, y = 70;
+  time_t pt = 0;
+
+  for (i = 0; i < 78; i++) {
+    time_t t = - (1 << i);
+    tmp = gmtime (&t);
+    if (tmp == NULL || tmp->tm_year > y) {
+      i--;
+      printf ("%d\n", pt);
+      return (i);
+      }
+
+    y = tmp->tm_year;
+    pt = t;
+    }
+  printf ("%d\n", pt);
+  return (0);
+  }
+EOCP
+set try
+if eval $compile; then
+    sGMTIME_min=`$run ./try`
+else
+    echo "Cannot determine sGMTIME_min"
+    fi
+$rm_try
+
 : check for type of arguments to select.
 case "$selecttype" in
 '') case "$d_select" in
@@ -22620,6 +22693,8 @@
 rmail='$rmail'
 run='$run'
 runnm='$runnm'
+sGMTIME_max='$sGMTIME_max'
+sGMTIME_min='$sGMTIME_min'
 sPRIEUldbl='$sPRIEUldbl'
 sPRIFUldbl='$sPRIFUldbl'
 sPRIGUldbl='$sPRIGUldbl'

==== //depot/perl/Porting/Glossary#191 (text) ====
Index: perl/Porting/Glossary
--- perl/Porting/Glossary#190~33845~    2008-05-17 07:29:24.000000000 -0700
+++ perl/Porting/Glossary       2008-07-07 13:03:00.000000000 -0700
@@ -4240,6 +4240,14 @@
        REENTRANT_PROTO_T_ABC macros of reentr.h if d_setservent_r
        is defined.
 
+sGMTIME_max (time_size.U):
+       This variable defines the maximum value of the time_t offset that
+       the system function gmtime () accepts
+
+sGMTIME_min (time_size.U):
+       This variable defines the minimum value of the time_t offset that
+       the system function gmtime () accepts
+
 sh (sh.U):
        This variable contains the full pathname of the shell used
        on this system to execute Bourne shell scripts.  Usually, this will be

==== //depot/perl/config_h.SH#347 (text) ====
Index: perl/config_h.SH
--- perl/config_h.SH#346~34064~ 2008-06-16 07:49:04.000000000 -0700
+++ perl/config_h.SH    2008-07-07 13:03:00.000000000 -0700
@@ -4446,6 +4446,17 @@
 #define STDIO_STREAM_ARRAY     $stdio_stream_array
 #endif
 
+/* GMTIME_MAX:
+ *     This symbol contains the maximum value for the time_t offset that
+ *     the system function gmtime () accepts, and defaults to 0
+ */
+/* GMTIME_MIN:
+ *     This symbol contains the minimum value for the time_t offset that
+ *     the system function gmtime () accepts, and defaults to 0
+ */
+#define GMTIME_MAX     $sGMTIME_max    /**/
+#define GMTIME_MIN     $sGMTIME_min    /**/
+
 /* USE_64_BIT_INT:
  *     This symbol, if defined, indicates that 64-bit integers should
  *     be used when available.  If not defined, the native integers

==== //depot/perl/handy.h#140 (text) ====
Index: perl/handy.h
--- perl/handy.h#139~33379~     2008-02-26 15:22:30.000000000 -0800
+++ perl/handy.h        2008-07-07 13:03:00.000000000 -0700
@@ -177,7 +177,7 @@
 #endif
 
 /* HMB H.Merijn Brand - a placeholder for preparing Configure patches */
-#if defined(LOCALTIME_R_NEEDS_TZSET) && defined(HAS_PSEUDOFORK) && 
defined(USE_DTRACE)
+#if defined(LOCALTIME_R_NEEDS_TZSET) && defined(HAS_PSEUDOFORK) && 
defined(USE_DTRACE) && defined(GMTIME_MAX) && defined(GMTIME_MIN)
 /* Not (yet) used at top level, but mention them for metaconfig */
 #endif
 
End of Patch.

Reply via email to