summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2000-01-19 17:36:56 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-01-19 17:36:56 +0000
commitcce08f5b9b7595afc792a45212fcf309dbd735ca (patch)
treea5635b7983b7582079b35e74befaca3557863260
parented5237f9db01e844a3ea31909a300586f94fc4a5 (diff)
downloadperl-cce08f5b9b7595afc792a45212fcf309dbd735ca.tar.gz
Add NV_PRESERVES_UV.
p4raw-id: //depot/cfgperl@4819
-rwxr-xr-xConfigure680
-rw-r--r--Porting/Glossary4
-rw-r--r--Porting/config.sh5
-rw-r--r--Porting/config_H10
-rw-r--r--config_h.SH5
-rw-r--r--perl.h2
6 files changed, 378 insertions, 328 deletions
diff --git a/Configure b/Configure
index 8c2abb258e..b561281a66 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 Tue Jan 18 23:09:49 EET 2000 [metaconfig 3.0 PL70]
+# Generated on Wed Jan 19 19:38:29 EET 2000 [metaconfig 3.0 PL70]
# (with additional metaconfig patches by perlbug@perl.com)
cat >/tmp/c1$$ <<EOF
@@ -760,6 +760,7 @@ subversion=''
version=''
perladmin=''
perlpath=''
+d_nvpresuv=''
i16size=''
i16type=''
i32size=''
@@ -4687,7 +4688,7 @@ $echo $n " patchlevel $patchlevel" $c
test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
echo ".)"
case "$osname" in
-dos|vms)
+dos|cygwin|vms|win32)
: XXX Should be a Configure test for double-dots in filenames.
version=`echo $baserev $patchlevel $subversion | \
$awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
@@ -9541,6 +9542,356 @@ eval $setvar
set nice d_nice
eval $inlibc
+: see if inttypes.h is available
+: we want a real compile instead of Inhdr because some systems
+: have an inttypes.h which includes non-existent headers
+echo " "
+$cat >try.c <<EOCP
+#include <inttypes.h>
+int main() {
+ static int32_t foo32 = 0x12345678;
+}
+EOCP
+set try
+if eval $compile; then
+ echo "<inttypes.h> found." >&4
+ val="$define"
+else
+ echo "<inttypes.h> NOT found." >&4
+ val="$undef"
+fi
+$rm -f try.c try
+set i_inttypes
+eval $setvar
+
+: check for int64_t
+echo " "
+$echo $n "Checking to see if your system supports int64_t...$c" >&4
+$cat >try.c <<EOCP
+#include <sys/types.h>
+#$i_inttypes I_INTTYPES
+#ifdef I_INTTYPES
+#include <inttypes.h>
+#endif
+int main() { int64_t x = 7; }
+EOCP
+set try
+if eval $compile; then
+ val="$define"
+ echo " Yes, it does." >&4
+else
+ val="$undef"
+ echo " No, it doesn't." >&4
+fi
+$rm -f try try.*
+set d_int64t
+eval $setvar
+
+
+echo " "
+echo "Checking which 64-bit integer type we could use..." >&4
+
+case "$intsize" in
+8) val=int
+ set quadtype
+ eval $setvar
+ val='"unsigned int"'
+ set uquadtype
+ eval $setvar
+ quadkind=1
+ ;;
+*) case "$longsize" in
+ 8) val=long
+ set quadtype
+ eval $setvar
+ val='"unsigned long"'
+ set uquadtype
+ eval $setvar
+ quadkind=2
+ ;;
+ *) case "$uselonglong:$d_longlong:$longlongsize" in
+ define:define:8)
+ val='"long long"'
+ set quadtype
+ eval $setvar
+ val='"unsigned long long"'
+ set uquadtype
+ eval $setvar
+ quadkind=3
+ ;;
+ *) case "$d_int64t" in
+ define)
+ val=int64_t
+ set quadtype
+ eval $setvar
+ val=uint64_t
+ set uquadtype
+ eval $setvar
+ quadkind=4
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+esac
+
+case "$quadtype" in
+'') case "$uselonglong:$d_longlong:$longlongsize" in
+ undef:define:8)
+ echo "(You would have 'long long', but you are not using it.)" >&4 ;;
+ *) echo "Alas, no 64-bit integer types in sight." >&4 ;;
+ esac
+ d_quad="$undef"
+ ;;
+*) if test X"$use64bits" = Xdefine -o X"$longsize" = X8; then
+ verb="will"
+ else
+ verb="could"
+ fi
+ echo "We $verb use '$quadtype' for 64-bit integers." >&4
+ d_quad="$define"
+ ;;
+esac
+
+: check for length of character
+echo " "
+case "$charsize" in
+'')
+ echo "Checking to see how big your characters are (hey, you never know)..." >&4
+ $cat >try.c <<'EOCP'
+#include <stdio.h>
+int main()
+{
+ printf("%d\n", (int)sizeof(char));
+ exit(0);
+}
+EOCP
+ set try
+ if eval $compile_ok; then
+ dflt=`./try`
+ else
+ dflt='1'
+ echo "(I can't seem to compile the test program. Guessing...)"
+ fi
+ ;;
+*)
+ dflt="$charsize"
+ ;;
+esac
+rp="What is the size of a character (in bytes)?"
+. ./myread
+charsize="$ans"
+$rm -f try.c try
+
+
+echo " "
+$echo "Choosing the C types to be used for Perl's internal types..." >&4
+
+case "$use64bits:$d_quad:$quadtype" in
+define:define:?*)
+ ivtype="$quadtype"
+ uvtype="$uquadtype"
+ ivsize=8
+ uvsize=8
+ ;;
+*) ivtype="long"
+ uvtype="unsigned long"
+ ivsize=$longsize
+ uvsize=$longsize
+ ;;
+esac
+
+case "$uselongdouble:$d_longdbl" in
+define:define)
+ nvtype="long double"
+ nvsize=$longdblsize
+ ;;
+*) nvtype=double
+ nvsize=$doublesize
+ ;;
+esac
+
+$echo "(IV will be "$ivtype", $ivsize bytes)"
+$echo "(UV will be "$uvtype", $uvsize bytes)"
+$echo "(NV will be "$nvtype", $nvsize bytes)"
+
+$cat >try.c <<EOCP
+#$i_inttypes I_INTTYPES
+#ifdef I_INTTYPES
+#include <inttypes.h>
+#endif
+#include <stdio.h>
+int main() {
+#ifdef INT8
+ int8_t i = INT8_MAX;
+ uint8_t u = UINT8_MAX;
+ printf("int8_t\n");
+#endif
+#ifdef INT16
+ int16_t i = INT16_MAX;
+ uint16_t i = UINT16_MAX;
+ printf("int16_t\n");
+#endif
+#ifdef INT32
+ int32_t i = INT32_MAX;
+ uint32_t u = UINT32_MAX;
+ printf("int32_t\n");
+#endif
+}
+EOCP
+
+case "$i8type" in
+'') case "$charsize" in
+ 1) i8type=char
+ u8type="unsigned char"
+ i8size=$charsize
+ u8size=$charsize
+ ;;
+ esac
+ ;;
+esac
+case "$i8type" in
+'') set try -DINT8
+ if eval $compile; then
+ case "`./try$exe_ext`" in
+ int8_t) i8type=int8_t
+ u8type=uint8_t
+ i8size=1
+ u8size=1
+ ;;
+ esac
+ fi
+ ;;
+esac
+case "$i8type" in
+'') if $test $charsize -ge 1; then
+ i8type=char
+ u8type="unsigned char"
+ i8size=$charsize
+ u8size=$charsize
+ fi
+ ;;
+esac
+
+case "$i16type" in
+'') case "$shortsize" in
+ 2) i16type=short
+ u16type="unsigned short"
+ i16size=$shortsize
+ u16size=$shortsize
+ ;;
+ esac
+ ;;
+esac
+case "$i16type" in
+'') set try -DINT16
+ if eval $compile; then
+ case "`./try$exe_ext`" in
+ int16_t)
+ i16type=int16_t
+ u16type=uint16_t
+ i16size=2
+ u16size=2
+ ;;
+ esac
+ fi
+ ;;
+esac
+case "$i16type" in
+'') if $test $shortsize -ge 2; then
+ i16type=short
+ u16type="unsigned short"
+ i16size=$shortsize
+ u16size=$shortsize
+ fi
+ ;;
+esac
+
+case "$i32type" in
+'') case "$longsize" in
+ 4) i32type=long
+ u32type="unsigned long"
+ i32size=$longsize
+ u32size=$longsize
+ ;;
+ *) case "$intsize" in
+ 4) i32type=int
+ u32type="unsigned int"
+ i32size=$intsize
+ u32size=$intsize
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+esac
+case "$i32type" in
+'') set try -DINT32
+ if eval $compile; then
+ case "`./try$exe_ext`" in
+ int32_t)
+ i32type=int32_t
+ u32type=uint32_t
+ i32size=4
+ u32size=4
+ ;;
+ esac
+ fi
+ ;;
+esac
+case "$i32type" in
+'') if $test $intsize -ge 4; then
+ i32type=int
+ u32type="unsigned int"
+ i32size=$intsize
+ u32size=$intsize
+ fi
+ ;;
+esac
+
+case "$i64type" in
+'') case "$d_quad:$quadtype" in
+ define:?*)
+ i64type="$quadtype"
+ u64type="$uquadtype"
+ i64size=8
+ u64size=8
+ ;;
+ esac
+ ;;
+esac
+
+$echo "Checking whether your NVs can preserve your UVs..." >&4
+$cat <<EOP >try.c
+#include <stdio.h>
+int main() {
+ $uvtype k = ($uvtype)~0, l;
+ $nvtype d;
+ l = k;
+ d = ($nvtype)l;
+ l = ($uvtype)d;
+ if (l == k)
+ printf("preserve\n");
+ exit(0);
+}
+EOP
+set try
+if eval $compile; then
+ case "`./try$exe_ext`" in
+ preserve) d_nvpresuv="$define" ;;
+ esac
+fi
+case "$d_nvpresuv" in
+$define) $echo "Yes, they can." 2>&1 ;;
+*) $echo "No, they can't." 2>&1
+ d_nvpresuv="$undef"
+ ;;
+esac
+
+$rm -f try.* try
+
: see if POSIX threads are available
set pthread.h i_pthread
eval $inhdr
@@ -9776,119 +10127,6 @@ $define)
;;
esac
-: see if inttypes.h is available
-: we want a real compile instead of Inhdr because some systems
-: have an inttypes.h which includes non-existent headers
-echo " "
-$cat >try.c <<EOCP
-#include <inttypes.h>
-int main() {
- static int32_t foo32 = 0x12345678;
-}
-EOCP
-set try
-if eval $compile; then
- echo "<inttypes.h> found." >&4
- val="$define"
-else
- echo "<inttypes.h> NOT found." >&4
- val="$undef"
-fi
-$rm -f try.c try
-set i_inttypes
-eval $setvar
-
-: check for int64_t
-echo " "
-$echo $n "Checking to see if your system supports int64_t...$c" >&4
-$cat >try.c <<EOCP
-#include <sys/types.h>
-#$i_inttypes I_INTTYPES
-#ifdef I_INTTYPES
-#include <inttypes.h>
-#endif
-int main() { int64_t x = 7; }
-EOCP
-set try
-if eval $compile; then
- val="$define"
- echo " Yes, it does." >&4
-else
- val="$undef"
- echo " No, it doesn't." >&4
-fi
-$rm -f try try.*
-set d_int64t
-eval $setvar
-
-
-echo " "
-echo "Checking which 64-bit integer type we could use..." >&4
-
-case "$intsize" in
-8) val=int
- set quadtype
- eval $setvar
- val='"unsigned int"'
- set uquadtype
- eval $setvar
- quadkind=1
- ;;
-*) case "$longsize" in
- 8) val=long
- set quadtype
- eval $setvar
- val='"unsigned long"'
- set uquadtype
- eval $setvar
- quadkind=2
- ;;
- *) case "$uselonglong:$d_longlong:$longlongsize" in
- define:define:8)
- val='"long long"'
- set quadtype
- eval $setvar
- val='"unsigned long long"'
- set uquadtype
- eval $setvar
- quadkind=3
- ;;
- *) case "$d_int64t" in
- define)
- val=int64_t
- set quadtype
- eval $setvar
- val=uint64_t
- set uquadtype
- eval $setvar
- quadkind=4
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
-esac
-
-case "$quadtype" in
-'') case "$uselonglong:$d_longlong:$longlongsize" in
- undef:define:8)
- echo "(You would have 'long long', but you are not using it.)" >&4 ;;
- *) echo "Alas, no 64-bit integer types in sight." >&4 ;;
- esac
- d_quad="$undef"
- ;;
-*) if test X"$use64bits" = Xdefine -o X"$longsize" = X8; then
- verb="will"
- else
- verb="could"
- fi
- echo "We $verb use '$quadtype' for 64-bit integers." >&4
- d_quad="$define"
- ;;
-esac
-
: see if readdir and friends exist
set readdir d_readdir
eval $inlibc
@@ -12111,216 +12349,6 @@ else
fi
-: check for length of character
-echo " "
-case "$charsize" in
-'')
- echo "Checking to see how big your characters are (hey, you never know)..." >&4
- $cat >try.c <<'EOCP'
-#include <stdio.h>
-int main()
-{
- printf("%d\n", (int)sizeof(char));
- exit(0);
-}
-EOCP
- set try
- if eval $compile_ok; then
- dflt=`./try`
- else
- dflt='1'
- echo "(I can't seem to compile the test program. Guessing...)"
- fi
- ;;
-*)
- dflt="$charsize"
- ;;
-esac
-rp="What is the size of a character (in bytes)?"
-. ./myread
-charsize="$ans"
-$rm -f try.c try
-
-
-echo " "
-$echo "Choosing the C types to be used for Perl's internal types..." >&4
-
-case "$use64bits:$d_quad:$quadtype" in
-define:define:?*)
- ivtype="$quadtype"
- uvtype="$uquadtype"
- ivsize=8
- uvsize=8
- ;;
-*) ivtype="long"
- uvtype="unsigned long"
- ivsize=$longsize
- uvsize=$longsize
- ;;
-esac
-
-case "$uselongdouble:$d_longdbl" in
-define:define)
- nvtype="long double"
- nvsize=$longdblsize
- ;;
-*) nvtype=double
- nvsize=$doublesize
- ;;
-esac
-
-echo "(IV will be "$ivtype", $ivsize bytes)"
-echo "(UV will be "$uvtype", $uvsize bytes)"
-echo "(NV will be "$nvtype", $nvsize bytes)"
-
-$cat >try.c <<EOCP
-#$i_inttypes I_INTTYPES
-#ifdef I_INTTYPES
-#include <inttypes.h>
-#endif
-#include <stdio.h>
-int main() {
-#ifdef INT8
- int8_t i = INT8_MAX;
- uint8_t u = UINT8_MAX;
- printf("int8_t\n");
-#endif
-#ifdef INT16
- int16_t i = INT16_MAX;
- uint16_t i = UINT16_MAX;
- printf("int16_t\n");
-#endif
-#ifdef INT32
- int32_t i = INT32_MAX;
- uint32_t u = UINT32_MAX;
- printf("int32_t\n");
-#endif
-}
-EOCP
-
-case "$i8type" in
-'') case "$charsize" in
- 1) i8type=char
- u8type="unsigned char"
- i8size=$charsize
- u8size=$charsize
- ;;
- esac
- ;;
-esac
-case "$i8type" in
-'') set try -DINT8
- if eval $compile; then
- case "`./try$exe_ext`" in
- int8_t) i8type=int8_t
- u8type=uint8_t
- i8size=1
- u8size=1
- ;;
- esac
- fi
- ;;
-esac
-case "$i8type" in
-'') if $test $charsize -ge 1; then
- i8type=char
- u8type="unsigned char"
- i8size=$charsize
- u8size=$charsize
- fi
- ;;
-esac
-
-case "$i16type" in
-'') case "$shortsize" in
- 2) i16type=short
- u16type="unsigned short"
- i16size=$shortsize
- u16size=$shortsize
- ;;
- esac
- ;;
-esac
-case "$i16type" in
-'') set try -DINT16
- if eval $compile; then
- case "`./try$exe_ext`" in
- int16_t)
- i16type=int16_t
- u16type=uint16_t
- i16size=2
- u16size=2
- ;;
- esac
- fi
- ;;
-esac
-case "$i16type" in
-'') if $test $shortsize -ge 2; then
- i16type=short
- u16type="unsigned short"
- i16size=$shortsize
- u16size=$shortsize
- fi
- ;;
-esac
-
-case "$i32type" in
-'') case "$longsize" in
- 4) i32type=long
- u32type="unsigned long"
- i32size=$longsize
- u32size=$longsize
- ;;
- *) case "$intsize" in
- 4) i32type=int
- u32type="unsigned int"
- i32size=$intsize
- u32size=$intsize
- ;;
- esac
- ;;
- esac
- ;;
-esac
-case "$i32type" in
-'') set try -DINT32
- if eval $compile; then
- case "`./try$exe_ext`" in
- int32_t)
- i32type=int32_t
- u32type=uint32_t
- i32size=4
- u32size=4
- ;;
- esac
- fi
- ;;
-esac
-case "$i32type" in
-'') if $test $intsize -ge 4; then
- i32type=int
- u32type="unsigned int"
- i32size=$intsize
- u32size=$intsize
- fi
- ;;
-esac
-
-case "$i64type" in
-'') case "$d_quad:$quadtype" in
- define:?*)
- i64type="$quadtype"
- u64type="$uquadtype"
- i64size=8
- u64size=8
- ;;
- esac
- ;;
-esac
-
-$rm -f try.* try
-
echo " "
if $test X"$quadtype" != X; then
@@ -12892,6 +12920,7 @@ $rm -f foo* bar*
case "$selecttype" in
'') case "$d_select" in
$define)
+ echo " "
$cat <<EOM
Checking to see what type of arguments are accepted by select().
EOM
@@ -14557,6 +14586,7 @@ d_msgrcv='$d_msgrcv'
d_msgsnd='$d_msgsnd'
d_mymalloc='$d_mymalloc'
d_nice='$d_nice'
+d_nvpresuv='$d_nvpresuv'
d_off64_t='$d_off64_t'
d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
d_oldpthreads='$d_oldpthreads'
diff --git a/Porting/Glossary b/Porting/Glossary
index bde26b736a..e4028b3e67 100644
--- a/Porting/Glossary
+++ b/Porting/Glossary
@@ -942,6 +942,10 @@ d_nice (d_nice.U):
This variable conditionally defines the HAS_NICE symbol, which
indicates to the C program that the nice() routine is available.
+d_nvpresuv (perlxv.U):
+ This variable indicates whether a variable of type nvtype
+ can preserve all the bits a variable of type uvtype.
+
d_off64_t (io64.U):
This symbol will be defined if the C compiler supports off64_t.
diff --git a/Porting/config.sh b/Porting/config.sh
index eebf57fe62..b9b8bd065b 100644
--- a/Porting/config.sh
+++ b/Porting/config.sh
@@ -8,7 +8,7 @@
# Package name : perl5
# Source directory : .
-# Configuration time: Sun Jan 16 21:10:53 EET 2000
+# Configuration time: Wed Jan 19 19:31:56 EET 2000
# Configured by : jhi
# Target system : osf1 alpha.hut.fi v4.0 878 alpha
@@ -59,7 +59,7 @@ ccflags='-pthread -std -DLANGUAGE_C'
ccsymbols='__LANGUAGE_C__=1 _LONGLONG=1 LANGUAGE_C=1 SYSTYPE_BSD=1'
cf_by='jhi'
cf_email='yourname@yourhost.yourplace.com'
-cf_time='Sun Jan 16 21:10:53 EET 2000'
+cf_time='Wed Jan 19 19:31:56 EET 2000'
charsize='1'
chgrp=''
chmod=''
@@ -229,6 +229,7 @@ d_msgrcv='define'
d_msgsnd='define'
d_mymalloc='undef'
d_nice='define'
+d_nvpresuv='undef'
d_off64_t='undef'
d_old_pthread_create_joinable='undef'
d_oldpthreads='undef'
diff --git a/Porting/config_H b/Porting/config_H
index 94007e9e3c..92d77723f2 100644
--- a/Porting/config_H
+++ b/Porting/config_H
@@ -17,7 +17,7 @@
/*
* Package name : perl5
* Source directory : .
- * Configuration time: Sun Jan 16 21:10:53 EET 2000
+ * Configuration time: Wed Jan 19 19:31:56 EET 2000
* Configured by : jhi
* Target system : osf1 alpha.hut.fi v4.0 878 alpha
*/
@@ -1533,6 +1533,9 @@
* the GNU C library is being used.
*/
/*#define HAS_GNULIBC / **/
+#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)
+# define _GNU_SOURCE
+#endif
/* HAS_HASMNTOPT:
* This symbol, if defined, indicates that the hasmntopt routine is
* available to query the mount options of file systems.
@@ -2480,6 +2483,10 @@
/* U64SIZE:
* This symbol contains the sizeof(U64).
*/
+/* NV_PRESERVES_UV:
+ * This symbol, if defined, indicates that a variable of type NVTYPE
+ * can preserve all the bit of a variable of type UVSIZE.
+ */
#define IVTYPE long /**/
#define UVTYPE unsigned long /**/
#define I8TYPE char /**/
@@ -2505,6 +2512,7 @@
#define I64SIZE 8 /**/
#define U64SIZE 8 /**/
#endif
+#undef NV_PRESERVES_UV
/* IVdf:
* This symbol defines the format string used for printing a Perl IV
diff --git a/config_h.SH b/config_h.SH
index f5f4bc952b..9bbaa9014c 100644
--- a/config_h.SH
+++ b/config_h.SH
@@ -2497,6 +2497,10 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
/* U64SIZE:
* This symbol contains the sizeof(U64).
*/
+/* NV_PRESERVES_UV:
+ * This symbol, if defined, indicates that a variable of type NVTYPE
+ * can preserve all the bit of a variable of type UVSIZE.
+ */
#define IVTYPE $ivtype /**/
#define UVTYPE $uvtype /**/
#define I8TYPE $i8type /**/
@@ -2522,6 +2526,7 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
#define I64SIZE $i64size /**/
#define U64SIZE $u64size /**/
#endif
+#$d_nvpresuv NV_PRESERVES_UV
/* IVdf:
* This symbol defines the format string used for printing a Perl IV
diff --git a/perl.h b/perl.h
index 30130fd262..bdab13e3db 100644
--- a/perl.h
+++ b/perl.h
@@ -1870,6 +1870,8 @@ struct ptr_tbl {
#define U_V(what) (cast_uv((NV)(what)))
#endif
+/* Mention NV_PRESERVES_UV so that Configure picks it up. */
+
/* These do not care about the fractional part, only about the range. */
#define NV_WITHIN_IV(nv) (I_V(nv) >= IV_MIN && I_V(nv) <= IV_MAX)
#define NV_WITHIN_UV(nv) ((nv)>=0.0 && U_V(nv) >= UV_MIN && U_V(nv) <= UV_MAX)