summaryrefslogtreecommitdiff
path: root/Configure
diff options
context:
space:
mode:
authorH.Merijn Brand <h.m.brand@xs4all.nl>2008-09-15 08:22:14 +0000
committerDavid Mitchell <davem@iabyn.com>2009-01-02 20:22:20 +0000
commited5cc6be3134bfc801db423b0fcfbc0f9760510e (patch)
treed37f11042af47db9174bc32e8f3476b146e163d9 /Configure
parent78cab4ca98b0691f9dbae275d9744272c0bd4de5 (diff)
downloadperl-ed5cc6be3134bfc801db423b0fcfbc0f9760510e.tar.gz
Add probes for LOCALTIME_max and LOCALTIME_min (y2038 project)
p4raw-id: //depot/perl@34363 (cherry picked from commit 73e6e416ba5c167dc94e3d9723be81ed2dff177b)
Diffstat (limited to 'Configure')
-rwxr-xr-xConfigure145
1 files changed, 110 insertions, 35 deletions
diff --git a/Configure b/Configure
index 6e5e74c28f..3225d34eeb 100755
--- a/Configure
+++ b/Configure
@@ -25,7 +25,7 @@
# $Id: Head.U 6 2006-08-25 22:21:46Z rmanfredi $
#
-# Generated on Fri Aug 22 17:08:28 CEST 2008 [metaconfig 3.5 PL0]
+# Generated on Mon Sep 15 10:06:16 CEST 2008 [metaconfig 3.5 PL0]
# (with additional metaconfig patches by perlbug@perl.org)
cat >c1$$ <<EOF
@@ -1175,6 +1175,8 @@ stdio_stream_array=''
sysman=''
sGMTIME_max=''
sGMTIME_min=''
+sLOCALTIME_max=''
+sLOCALTIME_min=''
trnl=''
uidformat=''
uidsign=''
@@ -20047,7 +20049,7 @@ $rm -f foo* bar*
set values.h i_values
eval $inhdr
-: Check the max offset that gmtime accepts
+: Check the max offset that gmtime and localtime accept
echo "Checking max offsets that gmtime () accepts"
case $i_values in
@@ -20076,57 +20078,128 @@ void gm_check (time_t t)
int check_max ()
{
- tmp = NULL;
- pt = 0;
+ tmp = NULL;
+ pt = 0;
#ifdef MAXLONG
- gm_check (MAXLONG);
+ gm_check (MAXLONG);
#endif
- if (tmp == NULL || tmp->tm_year < 0) {
- for (i = 63; i >= 0; i--) {
- time_t x = pt | ((time_t)1 << i);
- if (x < 0) continue;
- gm_check (x);
- }
- }
- printf ("sGMTIME_max=%ld\n", pt);
- return (0);
- }
+ if (tmp == NULL || tmp->tm_year < 0) {
+ for (i = 63; i >= 0; i--) {
+ time_t x = pt | ((time_t)1 << i);
+ if (x < 0) continue;
+ gm_check (x);
+ }
+ }
+ printf ("sGMTIME_max=%ld\n", pt);
+ return (0);
+ } /* check_max */
int check_min ()
{
- tmp = NULL;
- pt = 0;
+ tmp = NULL;
+ pt = 0;
#ifdef MINLONG
- gm_check (MINLONG);
+ gm_check (MINLONG);
#endif
- if (tmp == NULL) {
- for (i = 36; i >= 0; i--) {
- time_t x = pt - ((time_t)1 << i);
- if (x > 0) continue;
- gm_check (x);
- }
- }
- printf ("sGMTIME_min=%ld\n", pt);
- return (0);
- }
+ if (tmp == NULL) {
+ for (i = 36; i >= 0; i--) {
+ time_t x = pt - ((time_t)1 << i);
+ if (x > 0) continue;
+ gm_check (x);
+ }
+ }
+ printf ("sGMTIME_min=%ld\n", pt);
+ return (0);
+ } /* check_min */
int main (int argc, char *argv[])
{
- fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
- check_max ();
- check_min ();
- return (0);
- } /* main */
+ fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
+ check_max ();
+ check_min ();
+ return (0);
+ } /* main */
EOCP
set try
if eval $compile; then
- yyy=`$run ./try`
- eval $yyy
+ eval `$run ./try`
else
echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
fi
$rm_try
+echo "Checking max offsets that localtime () accepts"
+
+$cat >try.c <<EOCP
+#include <sys/types.h>
+#include <stdio.h>
+#include <time.h>
+$yyy
+
+int i;
+struct tm *tmp;
+time_t pt;
+
+void local_check (time_t t)
+{
+ tmp = localtime (&t);
+ if (tmp == NULL || tmp->tm_year < -1900)
+ tmp = NULL;
+ else
+ pt = t;
+ } /* local_check */
+
+int check_max ()
+{
+ tmp = NULL;
+ pt = 0;
+#ifdef MAXLONG
+ local_check (MAXLONG);
+#endif
+ if (tmp == NULL || tmp->tm_year < 0) {
+ for (i = 63; i >= 0; i--) {
+ time_t x = pt | ((time_t)1 << i);
+ if (x < 0) continue;
+ local_check (x);
+ }
+ }
+ printf ("sLOCALTIME_max=%ld\n", pt);
+ return (0);
+ } /* check_max */
+
+int check_min ()
+{
+ tmp = NULL;
+ pt = 0;
+#ifdef MINLONG
+ local_check (MINLONG);
+#endif
+ if (tmp == NULL) {
+ for (i = 36; i >= 0; i--) {
+ time_t x = pt - ((time_t)1 << i);
+ if (x > 0) continue;
+ local_check (x);
+ }
+ }
+ printf ("sLOCALTIME_min=%ld\n", pt);
+ return (0);
+ } /* check_min */
+
+int main (int argc, char *argv[])
+{
+ check_max ();
+ check_min ();
+ return (0);
+ } /* main */
+EOCP
+set try
+if eval $compile; then
+ eval `$run ./try`
+else
+ echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
+ fi
+$rm_try
+
: check for type of arguments to select.
case "$selecttype" in
'') case "$d_select" in
@@ -22746,6 +22819,8 @@ run='$run'
runnm='$runnm'
sGMTIME_max='$sGMTIME_max'
sGMTIME_min='$sGMTIME_min'
+sLOCALTIME_max='$sLOCALTIME_max'
+sLOCALTIME_min='$sLOCALTIME_min'
sPRIEUldbl='$sPRIEUldbl'
sPRIFUldbl='$sPRIFUldbl'
sPRIGUldbl='$sPRIGUldbl'