# $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 perlbug@perl.org)
cat >c1$$ <<EOF
d_stdio_stream_array=''
stdio_stream_array=''
sysman=''
+sGMTIME_max=''
+sGMTIME_min=''
trnl=''
uidformat=''
uidsign=''
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
rmail='$rmail'
run='$run'
runnm='$runnm'
+sGMTIME_max='$sGMTIME_max'
+sGMTIME_min='$sGMTIME_min'
sPRIEUldbl='$sPRIEUldbl'
sPRIFUldbl='$sPRIFUldbl'
sPRIGUldbl='$sPRIGUldbl'
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
#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
#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