Skip to content

Commit

Permalink
Add HAS_QUAD ($Config{d_quad}); use it.
Browse files Browse the repository at this point in the history
p4raw-id: //depot/cfgperl@4497
  • Loading branch information
jhi committed Oct 30, 1999
1 parent a22e52b commit de1c261
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 76 deletions.
130 changes: 68 additions & 62 deletions Configure
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
# Generated on Sat Oct 30 02:37:12 EET DST 1999 [metaconfig 3.0 PL70]
# Generated on Sat Oct 30 14:59:39 EET DST 1999 [metaconfig 3.0 PL70]
# (with additional metaconfig patches by perlbug@perl.com)

cat >/tmp/c1$$ <<EOF
Expand Down Expand Up @@ -798,6 +798,7 @@ sPRIi64=''
sPRIo64=''
sPRIu64=''
sPRIx64=''
d_quad=''
quadcase=''
quadtype=''
uquadtype=''
Expand Down Expand Up @@ -9534,6 +9535,65 @@ $define)
;;
esac


echo " "
echo "Checking which 64-bit integer type to use..." >&4

case "$intsize" in
8) val=int
set quadtype
eval $setvar
val='"unsigned int"'
set uquadtype
eval $setvar
quadcase=1
;;
*) case "$longsize" in
8) val=long
set quadtype
eval $setvar
val='"unsigned long"'
set uquadtype
eval $setvar
quadcase=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
quadcase=3
;;
*) case "$d_int64t" in
define)
val=int64_t
set quadtype
eval $setvar
val=uint64_t
set uquadtype
eval $setvar
quadcase=4
;;
esac
;;
esac
;;
esac
;;
esac

case "$quadtype" in
'') echo "Alas, no 64-bit integer types in sight." >&4
d_quad="$undef"
;;
*) echo "Using '$quadtype' for 64-bit integers." >&4
d_quad="$define"
;;
esac

: see if readdir and friends exist
set readdir d_readdir
eval $inlibc
Expand Down Expand Up @@ -11739,66 +11799,11 @@ else
fi



echo " "
echo "Checking which 64-bit integer type to use..." >&4

case "$intsize" in
8) val=int
set quadtype
eval $setvar
val='"unsigned int"'
set uquadtype
eval $setvar
quadcase=1
;;
*) case "$longsize" in
8) val=long
set quadtype
eval $setvar
val='"unsigned long"'
set uquadtype
eval $setvar
quadcase=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
quadcase=3
;;
*) case "$d_int64t" in
define)
val=int64_t
set quadtype
eval $setvar
val=uint64_t
set uquadtype
eval $setvar
quadcase=4
;;
esac
;;
esac
;;
esac
;;
esac

case "$quadtype" in
'') echo "Alas, no 64-bit integer types in sight." >&4 ;;
*) echo "Using '$quadtype' for 64-bit integers." >&4 ;;
esac

: check for length of character
echo " "
case "$charsize" in
'')
echo "Checking to see how big your characters are..." >&4
echo "Checking to see how big your characters are (hey, you never know)..." >&4
$cat >try.c <<'EOCP'
#include <stdio.h>
int main()
Expand Down Expand Up @@ -11827,8 +11832,8 @@ $rm -f try.c try
echo " "
$echo "Choosing the C types to be used for Perl's internal types..." >&4

case "$use64bits:$quadtype" in
define:?*)
case "$use64bits:$d_quad:$quadtype" in
define:define:?*)
ivtype="$quadtype"
uvtype="$uquadtype"
ivsize=8
Expand Down Expand Up @@ -11990,9 +11995,9 @@ case "$i32type" in
esac

case "$i64type" in
'') case "$quadtype" in
'') ;;
*) i64type="$quadtype"
'') case "$d_quad:$quadtype" in
define:?*)
i64type="$quadtype"
u64type="$uquadtype"
i64size=8
u64size=8
Expand Down Expand Up @@ -14256,6 +14261,7 @@ d_pwexpire='$d_pwexpire'
d_pwgecos='$d_pwgecos'
d_pwpasswd='$d_pwpasswd'
d_pwquota='$d_pwquota'
d_quad='$d_quad'
d_readdir='$d_readdir'
d_readlink='$d_readlink'
d_rename='$d_rename'
Expand Down
4 changes: 4 additions & 0 deletions Porting/Glossary
Original file line number Diff line number Diff line change
Expand Up @@ -1048,6 +1048,10 @@ d_pwquota (i_pwd.U):
This variable conditionally defines PWQUOTA, which indicates
that struct passwd contains pw_quota.

d_quad (quadtype.U):
This variable, if defined, tells that there's a 64-bit integer type,
quadtype.

d_readdir (d_readdir.U):
This variable conditionally defines HAS_READDIR if readdir() is
available to read directory entries.
Expand Down
5 changes: 3 additions & 2 deletions Porting/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

# Package name : perl5
# Source directory : .
# Configuration time: Sat Oct 30 02:40:27 EET DST 1999
# Configuration time: Sat Oct 30 15:31:32 EET DST 1999
# Configured by : jhi
# Target system : osf1 alpha.hut.fi v4.0 878 alpha

Expand Down Expand Up @@ -56,7 +56,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='Sat Oct 30 02:40:27 EET DST 1999'
cf_time='Sat Oct 30 15:31:32 EET DST 1999'
charsize='1'
chgrp=''
chmod=''
Expand Down Expand Up @@ -246,6 +246,7 @@ d_pwexpire='undef'
d_pwgecos='define'
d_pwpasswd='define'
d_pwquota='define'
d_quad='define'
d_readdir='define'
d_readlink='define'
d_rename='define'
Expand Down
17 changes: 11 additions & 6 deletions Porting/config_H
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/*
* Package name : perl5
* Source directory : .
* Configuration time: Sat Oct 30 02:40:27 EET DST 1999
* Configuration time: Sat Oct 30 15:31:32 EET DST 1999
* Configured by : jhi
* Target system : osf1 alpha.hut.fi v4.0 878 alpha
*/
Expand Down Expand Up @@ -984,6 +984,10 @@
*/
#define STDCHAR unsigned char /**/

/* HAS_QUAD:
* This symbol, if defined, tells that there's a 64-bit integer type,
* Quad_t.
*/
/* Quad_t:
* This symbol holds the type used for 64-bit integers.
* It can be int, long, long long, int64_t etc...
Expand All @@ -997,9 +1001,10 @@
* It can be unsigned int, unsigned long, unsigned long long,
* uint64_t etc...
*/
#define Quad_t long
#define Uquad_t unsigned long
#define QUADCASE 2
#define HAS_QUAD /**/
#define Quad_t long /**/
#define Uquad_t unsigned long /**/
#define QUADCASE 2 /**/

/* HAS_ACCESSX:
* This symbol, if defined, indicates that the accessx routine is
Expand Down Expand Up @@ -2462,7 +2467,7 @@
#define U16TYPE unsigned short /**/
#define I32TYPE int /**/
#define U32TYPE unsigned int /**/
#ifdef Quad_t
#ifdef HAS_QUAD
#define I64TYPE long /**/
#define U64TYPE unsigned long /**/
#endif
Expand All @@ -2475,7 +2480,7 @@
#define U16SIZE 2 /**/
#define I32SIZE 4 /**/
#define U32SIZE 4 /**/
#ifdef Quad_t
#ifdef HAS_QUAD
#define I64SIZE 8 /**/
#define U64SIZE 8 /**/
#endif
Expand Down
15 changes: 10 additions & 5 deletions config_h.SH
Original file line number Diff line number Diff line change
Expand Up @@ -998,6 +998,10 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
*/
#define STDCHAR $stdchar /**/
/* HAS_QUAD:
* This symbol, if defined, tells that there's a 64-bit integer type,
* Quad_t.
*/
/* Quad_t:
* This symbol holds the type used for 64-bit integers.
* It can be int, long, long long, int64_t etc...
Expand All @@ -1011,9 +1015,10 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
* It can be unsigned int, unsigned long, unsigned long long,
* uint64_t etc...
*/
#define Quad_t $quadtype
#define Uquad_t $uquadtype
#define QUADCASE $quadcase
#$d_quad HAS_QUAD /**/
#$d_quad Quad_t $quadtype /**/
#$d_quad Uquad_t $uquadtype /**/
#$d_quad QUADCASE $quadcase /**/
/* HAS_ACCESSX:
* This symbol, if defined, indicates that the accessx routine is
Expand Down Expand Up @@ -2476,7 +2481,7 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
#define U16TYPE $u16type /**/
#define I32TYPE $i32type /**/
#define U32TYPE $u32type /**/
#ifdef Quad_t
#ifdef HAS_QUAD
#define I64TYPE $i64type /**/
#define U64TYPE $u64type /**/
#endif
Expand All @@ -2489,7 +2494,7 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
#define U16SIZE $u16size /**/
#define I32SIZE $i32size /**/
#define U32SIZE $u32size /**/
#ifdef Quad_t
#ifdef HAS_QUAD
#define I64SIZE $i64size /**/
#define U64SIZE $u64size /**/
#endif
Expand Down
6 changes: 5 additions & 1 deletion perl.h
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ Free_t Perl_mfree (Malloc_t where);
typedef IVTYPE IV;
typedef UVTYPE UV;

#ifdef USE_64_BITS
#if defined(USE_64_BITS) && defined(HAS_QUAD)
# if QUADCASE == 4 && defined(INT64_MAX) /* quad is int64_t */
# define IV_MAX INT64_MAX
# define IV_MIN INT64_MIN
Expand Down Expand Up @@ -943,9 +943,13 @@ typedef UVTYPE UV;
# if IVSIZE == 8
# define IV_IS_QUAD
# define UV_IS_QUAD
# ifndef HAS_QUAD
# define HAS_QUAD
# endif
# else
# undef IV_IS_QUAD
# undef UV_IS_QUAD
# undef HAS_QUAD
# endif
#endif

Expand Down

0 comments on commit de1c261

Please sign in to comment.