summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-06-08 14:15:32 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-06-08 14:15:32 +0000
commite67aeab17662a70a2316911b8ee5b43fdf6f7241 (patch)
treee3eca0ad4b75893ddf06d7df92e3888695fd4454
parentc6966feaee0c3ed89d8fc30ec44b30cc2c61c5fc (diff)
downloadperl-e67aeab17662a70a2316911b8ee5b43fdf6f7241.tar.gz
Be inspired more by Hugo-- introduce HAS_MODFL_POW32_BUG.
p4raw-id: //depot/perl@10479
-rwxr-xr-xConfigure8
-rw-r--r--Porting/Glossary7
-rw-r--r--Porting/config.sh9
-rw-r--r--Porting/config_H10
-rw-r--r--config_h.SH8
-rw-r--r--configure.com1
-rw-r--r--epoc/config.sh1
-rw-r--r--pp.c18
-rw-r--r--uconfig.h22
-rwxr-xr-xuconfig.sh12
-rw-r--r--vos/config.alpha.def1
-rw-r--r--vos/config.ga.def1
-rw-r--r--win32/config.bc1
-rw-r--r--win32/config.gc1
-rw-r--r--win32/config.vc1
15 files changed, 81 insertions, 20 deletions
diff --git a/Configure b/Configure
index df3574246b..7ba331a1a0 100755
--- a/Configure
+++ b/Configure
@@ -20,7 +20,7 @@
# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Fri Jun 8 02:03:31 EET DST 2001 [metaconfig 3.0 PL70]
+# Generated on Fri Jun 8 18:06:31 EET DST 2001 [metaconfig 3.0 PL70]
# (with additional metaconfig patches by perlbug@perl.org)
cat >c1$$ <<EOF
@@ -450,6 +450,7 @@ d_mktime=''
d_mmap=''
mmaptype=''
d_modfl=''
+d_modfl_pow32_bug=''
d_mprotect=''
d_msg=''
d_msgctl=''
@@ -10476,6 +10477,8 @@ esac
set modfl d_modfl
eval $inlibc
+d_modfl_pow32_bug="$undef"
+
case "$d_longdbl$d_modfl" in
$define$define)
$cat <<EOM
@@ -10505,7 +10508,7 @@ EOCP
case "$foo" in
*" 4294967303.150000 1.150000 4294967302.000000")
echo >&4 "Your modfl() is broken for large values."
- d_modfl="$undef"
+ d_modfl_pow32_bug="$define"
case "$foo" in
glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
;;
@@ -16444,6 +16447,7 @@ d_mkstemps='$d_mkstemps'
d_mktime='$d_mktime'
d_mmap='$d_mmap'
d_modfl='$d_modfl'
+d_modfl_pow32_bug='$d_modfl_pow32_bug'
d_mprotect='$d_mprotect'
d_msg='$d_msg'
d_msg_ctrunc='$d_msg_ctrunc'
diff --git a/Porting/Glossary b/Porting/Glossary
index aef6a26de5..6995d08014 100644
--- a/Porting/Glossary
+++ b/Porting/Glossary
@@ -1005,6 +1005,13 @@ d_modfl (d_modfl.U):
This variable conditionally defines the HAS_MODFL symbol, which
indicates to the C program that the modfl() routine is available.
+d_modfl_pow32_bug (d_modfl.U):
+ This variable conditionally defines the HAS_MODFL_POW32_BUG symbol,
+ which indicates that modfl() is broken for long doubles >= pow(2, 32).
+ For example from 4294967303.150000 one would get 4294967302.000000
+ and 1.150000. The bug has been seen in certain versions of glibc,
+ release 2.2.2 is known to be okay.
+
d_mprotect (d_mprotect.U):
This variable conditionally defines HAS_MPROTECT if mprotect() is
available to modify the access protection of a memory mapped file.
diff --git a/Porting/config.sh b/Porting/config.sh
index 51ec9c3289..f225a7b2e8 100644
--- a/Porting/config.sh
+++ b/Porting/config.sh
@@ -8,7 +8,7 @@
# Package name : perl5
# Source directory : .
-# Configuration time: Fri Jun 8 04:49:05 EET DST 2001
+# Configuration time: Fri Jun 8 18:08:58 EET DST 2001
# Configured by : jhi
# Target system : osf1 alpha.hut.fi v4.0 878 alpha
@@ -63,7 +63,7 @@ ccsymbols='__alpha=1 __LANGUAGE_C__=1 __osf__=1 __unix__=1 _LONGLONG=1 _SYSTYPE_
ccversion='V5.6-082'
cf_by='jhi'
cf_email='yourname@yourhost.yourplace.com'
-cf_time='Fri Jun 8 04:49:05 EET DST 2001'
+cf_time='Fri Jun 8 18:08:58 EET DST 2001'
charsize='1'
chgrp=''
chmod=''
@@ -243,6 +243,7 @@ d_mkstemps='undef'
d_mktime='define'
d_mmap='define'
d_modfl='undef'
+d_modfl_pow32_bug='undef'
d_mprotect='define'
d_msg='define'
d_msg_ctrunc='define'
@@ -669,7 +670,7 @@ patchlevel='7'
path_sep=':'
perl5='/u/vieraat/vieraat/jhi/Perl/bin/perl'
perl=''
-perl_patchlevel='10438'
+perl_patchlevel='10475'
perladmin='yourname@yourhost.yourplace.com'
perllibs='-lm -liconv -lutil -lpthread -lexc'
perlpath='/opt/perl/bin/perl'
@@ -864,7 +865,7 @@ PERL_SUBVERSION=1
PERL_API_REVISION=5
PERL_API_VERSION=5
PERL_API_SUBVERSION=0
-PERL_PATCHLEVEL=10438
+PERL_PATCHLEVEL=10475
PERL_CONFIG_SH=true
# Variables propagated from previous config.sh file.
pp_sys_cflags='ccflags="$ccflags -DNO_EFF_ONLY_OK"'
diff --git a/Porting/config_H b/Porting/config_H
index ede0f5b804..fa60e914a7 100644
--- a/Porting/config_H
+++ b/Porting/config_H
@@ -17,7 +17,7 @@
/*
* Package name : perl5
* Source directory : .
- * Configuration time: Fri Jun 8 04:49:05 EET DST 2001
+ * Configuration time: Fri Jun 8 18:08:58 EET DST 2001
* Configured by : jhi
* Target system : osf1 alpha.hut.fi v4.0 878 alpha
*/
@@ -1780,7 +1780,15 @@
* available to split a long double x into a fractional part f and
* an integer part i such that |f| < 1.0 and (f + i) = x.
*/
+/* HAS_MODFL_POW32_BUG:
+ * This symbol, if defined, indicates that the modfl routine is
+ * broken for long doubles >= pow(2, 32).
+ * For example from 4294967303.150000 one would get 4294967302.000000
+ * and 1.150000. The bug has been seen in certain versions of glibc,
+ * release 2.2.2 is known to be okay.
+ */
/*#define HAS_MODFL / **/
+/*#define HAS_MODFL_POW32_BUG / **/
/* HAS_MPROTECT:
* This symbol, if defined, indicates that the mprotect system call is
diff --git a/config_h.SH b/config_h.SH
index b8a248112b..b3a8c7e88a 100644
--- a/config_h.SH
+++ b/config_h.SH
@@ -1800,7 +1800,15 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un
* available to split a long double x into a fractional part f and
* an integer part i such that |f| < 1.0 and (f + i) = x.
*/
+/* HAS_MODFL_POW32_BUG:
+ * This symbol, if defined, indicates that the modfl routine is
+ * broken for long doubles >= pow(2, 32).
+ * For example from 4294967303.150000 one would get 4294967302.000000
+ * and 1.150000. The bug has been seen in certain versions of glibc,
+ * release 2.2.2 is known to be okay.
+ */
#$d_modfl HAS_MODFL /**/
+#$d_modfl_pow32_bug HAS_MODFL_POW32_BUG /**/
/* HAS_MPROTECT:
* This symbol, if defined, indicates that the mprotect system call is
diff --git a/configure.com b/configure.com
index aae059e5ff..b18a1ca504 100644
--- a/configure.com
+++ b/configure.com
@@ -5124,6 +5124,7 @@ $ WC "d_mkstemps='" + d_mkstemps + "'"
$ WC "d_mktime='" + d_mktime + "'"
$ WC "d_mmap='undef'"
$ WC "d_modfl='" + d_modfl + "'"
+$ WC "d_modfl_pow32_bug = "undef"'
$ WC "d_mprotect='undef'"
$ WC "d_msg='undef'"
$ WC "d_msg_ctrunc='undef'"
diff --git a/epoc/config.sh b/epoc/config.sh
index b2e3fe627f..e9a5cd61cc 100644
--- a/epoc/config.sh
+++ b/epoc/config.sh
@@ -232,6 +232,7 @@ d_mkfifo='undef'
d_mktime='define'
d_mmap='undef'
d_modfl='undef'
+d_modfl_pow32_bug='undef'
d_mprotect='undef'
d_msg='undef'
d_msg_ctrunc='undef'
diff --git a/pp.c b/pp.c
index a8b3e55cec..ebdf3fd98d 100644
--- a/pp.c
+++ b/pp.c
@@ -2598,7 +2598,16 @@ PP(pp_int)
SETu(U_V(value));
} else {
#if defined(HAS_MODFL) || defined(LONG_DOUBLE_EQUALS_DOUBLE)
+# ifdef HAS_MODFL_POW32_BUG
+/* some versions of glibc split (i + d) into (i-1, d+1) for 2^32 <= i < 2^64 */
+ {
+ NV offset = Perl_modf(value, &value);
+ (void)Perl_modf(offset, &offset);
+ value += offset;
+ }
+# else
(void)Perl_modf(value, &value);
+# endif
#else
double tmp = (double)value;
(void)Perl_modf(tmp, &tmp);
@@ -2612,7 +2621,16 @@ PP(pp_int)
SETi(I_V(value));
} else {
#if defined(HAS_MODFL) || defined(LONG_DOUBLE_EQUALS_DOUBLE)
+# ifdef HAS_MODFL_POW32_BUG
+/* some versions of glibc split (i + d) into (i-1, d+1) for 2^32 <= i < 2^64 */
+ {
+ NV offset = Perl_modf(-value, &value);
+ (void)Perl_modf(offset, &offset);
+ value += offset;
+ }
+# else
(void)Perl_modf(-value, &value);
+# endif
value = -value;
#else
double tmp = (double)value;
diff --git a/uconfig.h b/uconfig.h
index 0c788f1237..7084a28cac 100644
--- a/uconfig.h
+++ b/uconfig.h
@@ -980,9 +980,9 @@
* This symbol contains the value of sizeof(short) so that the C
* preprocessor can make decisions based on it.
*/
-#define INTSIZE 1 /**/
+#define INTSIZE 4 /**/
#define LONGSIZE 4 /**/
-#define SHORTSIZE 1 /**/
+#define SHORTSIZE 2 /**/
/* MULTIARCH:
* This symbol, if defined, signifies that the build
@@ -1703,7 +1703,7 @@
*/
/*#define HAS_LONG_DOUBLE / **/
#ifdef HAS_LONG_DOUBLE
-#define LONG_DOUBLESIZE 1 /**/
+#define LONG_DOUBLESIZE 8 /**/
#endif
/* HAS_LONG_LONG:
@@ -1716,7 +1716,7 @@
*/
/*#define HAS_LONG_LONG / **/
#ifdef HAS_LONG_LONG
-#define LONGLONGSIZE 1 /**/
+#define LONGLONGSIZE 8 /**/
#endif
/* HAS_LSEEK_PROTO:
@@ -1776,7 +1776,15 @@
* available to split a long double x into a fractional part f and
* an integer part i such that |f| < 1.0 and (f + i) = x.
*/
+/* HAS_MODFL_POW32_BUG:
+ * This symbol, if defined, indicates that the modfl routine is
+ * broken for long doubles >= pow(2, 32).
+ * For example from 4294967303.150000 one would get 4294967302.000000
+ * and 1.150000. The bug has been seen in certain versions of glibc,
+ * release 2.2.2 is known to be okay.
+ */
/*#define HAS_MODFL / **/
+/*#define HAS_MODFL_POW32_BUG / **/
/* HAS_MPROTECT:
* This symbol, if defined, indicates that the mprotect system call is
@@ -2685,8 +2693,8 @@
* This symbol holds the number of bytes used by the Off_t.
*/
#define Off_t int /* <offset> type */
-#define LSEEKSIZE 1 /* <offset> size */
-#define Off_t_size 1 /* <offset> size */
+#define LSEEKSIZE 4 /* <offset> size */
+#define Off_t_size 4 /* <offset> size */
/* Free_t:
* This variable contains the return type of free(). It is usually
@@ -3075,7 +3083,7 @@
/* Size_t_size:
* This symbol holds the size of a Size_t in bytes.
*/
-#define Size_t_size 1 /* */
+#define Size_t_size 4 /* */
/* Size_t:
* This symbol holds the type used to declare length parameters
diff --git a/uconfig.sh b/uconfig.sh
index a6765d4bb4..5fdadea2e9 100755
--- a/uconfig.sh
+++ b/uconfig.sh
@@ -174,6 +174,7 @@ d_mkstemps='undef'
d_mktime='undef'
d_mmap='undef'
d_modfl='undef'
+d_modfl_pow32_bug='undef'
d_mprotect='undef'
d_msg='undef'
d_msg_ctrunc='undef'
@@ -460,15 +461,14 @@ inc_version_list_init='NULL'
installstyle='lib/perl5'
installusrbinperl='undef'
intsize='4'
-intsize=1
ivdformat='"ld"'
ivsize='4'
ivtype='long'
lib_ext='.a'
-longdblsize=1
-longlongsize=1
+longdblsize=8
+longlongsize=8
longsize='4'
-lseeksize=1
+lseeksize=4
lseektype=int
malloctype='int*'
malloctype='void *'
@@ -526,12 +526,12 @@ seedfunc='srand'
selectminbits='32'
selecttype=int
shmattype='void *'
-shortsize=1
+shortsize=2
sig_name_init='0'
sig_num_init='0'
sig_size='1'
signal_t=int
-sizesize=1
+sizesize=4
sizetype=int
socksizetype='int'
ssizetype=int
diff --git a/vos/config.alpha.def b/vos/config.alpha.def
index e532eac8fc..18be7797e9 100644
--- a/vos/config.alpha.def
+++ b/vos/config.alpha.def
@@ -157,6 +157,7 @@ $d_mkstemps='undef'
$d_mktime='define'
$d_mmap='undef'
$d_modfl='undef'
+$d_modfl_pow32_bug='undef'
$d_mprotect='undef'
$d_msg='undef'
$d_msg_ctrunc='undef'
diff --git a/vos/config.ga.def b/vos/config.ga.def
index 56410e282b..823bdb0168 100644
--- a/vos/config.ga.def
+++ b/vos/config.ga.def
@@ -157,6 +157,7 @@ $d_mkstemps='undef'
$d_mktime='define'
$d_mmap='define'
$d_modfl='undef'
+$d_modfl_pow32_bug='undef'
$d_mprotect='undef'
$d_msg='undef'
$d_msg_ctrunc='undef'
diff --git a/win32/config.bc b/win32/config.bc
index b8ee924d68..ee160fd6dd 100644
--- a/win32/config.bc
+++ b/win32/config.bc
@@ -227,6 +227,7 @@ d_mkstemps='undef'
d_mktime='define'
d_mmap='undef'
d_modfl='undef'
+d_modfl_pow32_bug='undef'
d_mprotect='undef'
d_msg='undef'
d_msg_ctrunc='undef'
diff --git a/win32/config.gc b/win32/config.gc
index 61438a0793..8adbe233a8 100644
--- a/win32/config.gc
+++ b/win32/config.gc
@@ -227,6 +227,7 @@ d_mkstemps='undef'
d_mktime='define'
d_mmap='undef'
d_modfl='undef'
+d_modfl_pow32_bug='undef'
d_mprotect='undef'
d_msg='undef'
d_msg_ctrunc='undef'
diff --git a/win32/config.vc b/win32/config.vc
index a7e5a1c079..5a7b20d2e4 100644
--- a/win32/config.vc
+++ b/win32/config.vc
@@ -227,6 +227,7 @@ d_mkstemps='undef'
d_mktime='define'
d_mmap='undef'
d_modfl='undef'
+d_modfl_pow32_bug='undef'
d_mprotect='undef'
d_msg='undef'
d_msg_ctrunc='undef'