From: Jarkko Hietaniemi Date: Fri, 29 Oct 1999 15:24:13 +0000 (+0000) Subject: Remove quad logic from perl.h; regen Configure; X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d7d93a8159c0ca10065c583e76157a51736a62cd;p=p5sagit%2Fp5-mst-13.2.git Remove quad logic from perl.h; regen Configure; add -DUSE_LONG_LONG to ccflags if not already there. p4raw-id: //depot/cfgperl@4487 --- diff --git a/Configure b/Configure index 267baf6..c0e5e24 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 Oct 29 00:58:35 EET DST 1999 [metaconfig 3.0 PL70] +# Generated on Fri Oct 29 17:37:33 EET DST 1999 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.com) cat >/tmp/c1$$ <. Versions 5.003_02 and later of perl allow alternate IO mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still @@ -6738,57 +6795,6 @@ EOP esac fi -: 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 < -int main() { - static int32_t foo32 = 0x12345678; -} -EOCP -set try -if eval $compile; then - echo " found." >&4 - val="$define" -else - echo " NOT found." >&4 - val="$undef" -fi -$rm -f try.c try -set i_inttypes -eval $setvar - -: check for int64_t -case "$use64bits" in -"$define" ) - echo " " - $echo $n "Checking to see if your system supports int64_t...$c" >&4 - $cat >try.c < -#$i_inttypes I_INTTYPES -#ifdef I_INTTYPES -#include -#endif -int64_t foo() { int64_t x; x = 7; return x; } -EOCP - if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then - val="$define" - echo " Yup, it does." >&4 - else - val="$undef" - echo " Nope, it doesn't." >&4 - fi - $rm -f try.* - ;; -*) val="$undef" - ;; -esac -set d_int64t -eval $setvar - - : check for lengths of integral types echo " " case "$intsize" in @@ -6837,14 +6843,15 @@ $rm -f intsize intsize.* : check for long long echo " " -$echo $n "Checking to see if your system supports long long...$c" >&4 -echo 'long long foo() { long long x; x = 7; return x; }' > try.c -if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then +$echo $n "Checking to see if your system supports long long..." $c >&4 +echo 'int main() { long long x = 7; }' > try.c +set try +if eval $compile; then val="$define" - echo " Yup, it does." >&4 + echo " Yes, it does." >&4 else val="$undef" - echo " Nope, it doesn't." >&4 + echo " No, it doesn't." >&4 fi $rm try.* set d_longlong @@ -6854,7 +6861,7 @@ eval $setvar case "${d_longlong}${longlongsize}" in $define) echo " " - $echo $n "Checking to see how big your long longs are...$c" >&4 + $echo $n "Checking to see how big your long longs are..." $c >&4 $cat >try.c <<'EOCP' #include int main() @@ -6864,7 +6871,7 @@ int main() EOCP set try if eval $compile_ok; then - longlongsize=`./try` + longlongsize=`./try$exe_ext` $echo " $longlongsize bytes." >&4 else dflt='8' @@ -6879,16 +6886,122 @@ EOCP fi ;; esac +$rm -f try.* try + +: 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 < +int main() { + static int32_t foo32 = 0x12345678; +} +EOCP +set try +if eval $compile; then + echo " found." >&4 + val="$define" +else + echo " NOT found." >&4 + val="$undef" +fi $rm -f try.c try +set i_inttypes +eval $setvar + +: check for int64_t +case "$use64bits" in +"$define" ) + echo " " + $echo $n "Checking to see if your system supports int64_t...$c" >&4 + $cat >try.c < +#$i_inttypes I_INTTYPES +#ifdef I_INTTYPES +#include +#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.* + ;; +*) val="$undef" + ;; +esac +set d_int64t +eval $setvar + + 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 -if $test X"$intsize" = X8 -o X"$longsize" = X8 -o X"$d_int64t" = X"$define" -o X"$d_longlong" = X"$define"; then +case "$quadtype" in +'') echo "Alas, no 64-bit integer types in sight." >&4 ;; +*) echo "Using '$quadtype' for 64-bit integers." >&4 ;; +esac + +echo " " + +if $test X"$quadtype" != X; then echo "Checking how to print 64-bit integers..." >&4 -if $test X"$sPRId64" = X -a X"$intsize" = X8; then - quad=int +if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then $cat >try.c <<'EOCP' #include #include @@ -6910,8 +7023,7 @@ EOCP fi fi -if $test X"$sPRId64" = X -a X"$longsize" = X8; then - quad=long +if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then $cat >try.c <<'EOCP' #include #include @@ -6933,8 +7045,7 @@ EOCP fi fi -if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$d_int64t" = X"$define"; then - quad=int64_t +if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$quadtype" = Xint64_t; then $cat >try.c <<'EOCP' #include #include @@ -6957,8 +7068,7 @@ EOCP fi fi -if $test X"$sPRId64" = X -a X"$d_longlong" = X"$define" -a X"$longlongsize" = X8; then - quad="long long" +if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then $cat >try.c <<'EOCP' #include #include @@ -6980,12 +7090,12 @@ EOCP fi fi -if $test X"$sPRId64" = X -a X"$quad" != X; then +if $test X"$sPRId64" = X -a X"$quadtype" != X; then $cat >try.c < #include int main() { - $quad q = 12345678901; + $quadtype q = 12345678901; printf("%Ld\n", q); } EOCP @@ -6996,18 +7106,18 @@ EOCP 12345678901) sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"'; sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"'; - echo "We will use %lld." + echo "We will use %Ld." ;; esac fi fi -if $test X"$sPRId64" = X -a X"$quad" != X; then +if $test X"$sPRId64" = X -a X"$quadtype" != X; then $cat >try.c < #include int main() { - $quad q = 12345678901; + $quadtype q = 12345678901; printf("%qd\n", q); } EOCP @@ -7030,7 +7140,7 @@ fi $rm -f try try.* -fi # intsize -o longsize -o d_int64t -o d_longlong +fi case "$sPRId64" in '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef"; @@ -7070,14 +7180,15 @@ $rm -f try.c try : check for long doubles echo " " -$echo $n "Checking to see if your system supports long double...$c" >&4 -echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c -if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then +$echo $n "Checking to see if your system supports long double..." $c >&4 +echo 'int main() { long double x = 7.0; }' > try.c +set try +if eval $compile; then val="$define" - echo " Yup, it does." >&4 + echo " Yes, it does." >&4 else val="$undef" - echo " Nope, it doesn't." >&4 + echo " No, it doesn't." >&4 fi $rm try.* set d_longdbl @@ -7087,7 +7198,7 @@ eval $setvar case "${d_longdbl}${longdblsize}" in $define) echo " " - $echo $n "Checking to see how big your long doubles are...$c" >&4 + $echo $n "Checking to see how big your long doubles are..." $c >&4 $cat >try.c <<'EOCP' #include int main() @@ -7096,8 +7207,9 @@ int main() } EOCP set try + set try if eval $compile; then - longdblsize=`./try` + longdblsize=`./try$exe_ext` $echo " $longdblsize bytes." >&4 else dflt='8' @@ -7112,7 +7224,7 @@ EOCP fi ;; esac -$rm -f try.c try +$rm -f try.* try echo " " @@ -8651,7 +8763,7 @@ eval $inhdr echo " " -echo "Checking to see if your system supports struct fs_data..." >&4 +$echo $n "Checking to see if your system supports struct fs_data..." $c >&4 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h eval $hasstruct case "$d_fs_data_s" in @@ -10291,7 +10403,7 @@ eval $inhdr echo " " -echo "Checking to see if your system supports struct statfs..." >&4 +$echo $n "Checking to see if your system supports struct statfs..." $c >&4 set d_statfs_s statfs $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h $i_sysvfs sys/vfs.h $i_sysstatfs sys/statfs.h eval $hasstruct case "$d_statfs_s" in @@ -10305,7 +10417,7 @@ esac case "$d_statfs_s" in define) echo " " - echo "Checking to see if your struct statfs has f_flags field..." >&4 + $echo $n "Checking to see if your struct statfs has f_flags field..." $c >&4 set d_statfs_f_flags statfs f_flags $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h $i_sysvfs sys/vfs.h $i_sysstatfs sys/statfs.h eval $hasfield ;; @@ -14096,6 +14208,8 @@ privlib='$privlib' privlibexp='$privlibexp' prototype='$prototype' ptrsize='$ptrsize' +quadcase='$quadcase' +quadtype='$quadtype' randbits='$randbits' randfunc='$randfunc' randseedtype='$randseedtype' @@ -14188,10 +14302,12 @@ uidsize='$uidsize' uidtype='$uidtype' uname='$uname' uniq='$uniq' +uquadtype='$uquadtype' use64bits='$use64bits' usedl='$usedl' uselargefiles='$uselargefiles' uselongdouble='$uselongdouble' +uselonglong='$uselonglong' usemorebits='$usemorebits' usemultiplicity='$usemultiplicity' usemymalloc='$usemymalloc' diff --git a/config_h.SH b/config_h.SH index 93f65e5..5cadb29 100644 --- a/config_h.SH +++ b/config_h.SH @@ -1900,7 +1900,9 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- * This symbol is defined if this system has a stat structure declaring * st_blksize and st_blocks. */ +#ifndef USE_STAT_BLOCKS #$d_statblks USE_STAT_BLOCKS /**/ +#endif /* HAS_STRERROR: * This symbol, if defined, indicates that the strerror routine is @@ -2442,39 +2444,63 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- * be used when available. If not defined, the native default interfaces * will be used (be they 32 or 64 bits). */ +#ifndef USE_64_BITS #$use64bits USE_64_BITS /**/ +#endif /* USE_LARGE_FILES: * This symbol, if defined, indicates that large file support * should be used when available. The USE_64_BITS symbol will * also be turned on if necessary. */ +#ifndef USE_LARGE_FILES #$uselargefiles USE_LARGE_FILES /**/ +#endif /* USE_LONG_DOUBLE: * This symbol, if defined, indicates that long doubles should * be used when available. */ +#ifndef USE_LONG_DOUBLE #$uselongdouble USE_LONG_DOUBLE /**/ +#endif + +/* USE_LONG_LONG: + * This symbol, if defined, indicates that long longs should + * be used when available. + */ +#ifndef USE_LONG_LONG +#$uselonglong USE_LONG_LONG /**/ +#endif + +#ifndef USE_MORE_BITS +#$usemorebits USE_MORE_BITS /**/ +#endif /* MULTIPLICITY: * This symbol, if defined, indicates that Perl should * be built to use multiplicity. */ +#ifndef MULTIPLICTY #$usemultiplicity MULTIPLICITY /**/ +#endif /* USE_PERLIO: * This symbol, if defined, indicates that the PerlIO abstraction should * be used throughout. If not defined, stdio should be * used in a fully backward compatible manner. */ +#ifndef USE_PERLIO #$useperlio USE_PERLIO /**/ +#endif /* USE_SOCKS: * This symbol, if defined, indicates that Perl should * be built to use socks. */ +#ifndef USE_SOCKS #$usesocks USE_SOCKS /**/ +#endif /* PERL_XS_APIVERSION: * This variable contains the version of the oldest perl binary @@ -2637,7 +2663,9 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- * This symbol, if defined, indicates that Perl should * be built to use the old draft POSIX threads API. */ +#ifndef USE_TTHREADS #$usethreads USE_THREADS /**/ +#endif #$d_oldpthreads OLD_PTHREADS_API /**/ /* Time_t: @@ -2707,6 +2735,23 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #define Pid_t $pidtype /* PID type */ +/* Quad_t: + * This symbol holds the type used for 64-bit integers. + * It can be int, long, long long, int64_t etc... + */ +/* QUADCASE: + * This symbol, if defined, encodes the type of a quad: + * 1 = int, 2 = long, 3 = long long, 4 = int64_t. + */ +/* Uquad_t: + * This symbol holds the type used for unsigned 64-bit integers. + * It can be unsigned int, unsigned long, unsigned long long, + * uint64_t etc... + */ +#define Quad_t $quadtype +#define Uquad_t $uquadtype +#define QUADCASE $quadcase + /* Size_t: * This symbol holds the type used to declare length parameters * for string functions. It is usually size_t, but may be diff --git a/doop.c b/doop.c index 1b7d02d..1ad8bfa 100644 --- a/doop.c +++ b/doop.c @@ -737,7 +737,7 @@ Perl_do_vecget(pTHX_ SV *sv, I32 offset, I32 size) ((UV) s[offset + 1] << 16) + ( s[offset + 2] << 8); } -#ifdef HAS_QUAD +#ifdef UV_IS_QUAD else if (size == 64) { dTHR; if (ckWARN(WARN_PORTABLE)) @@ -807,7 +807,7 @@ Perl_do_vecget(pTHX_ SV *sv, I32 offset, I32 size) ((UV) s[offset + 1] << 16) + ( s[offset + 2] << 8) + s[offset + 3]; -#ifdef HAS_QUAD +#ifdef UV_IS_QUAD else if (size == 64) { dTHR; if (ckWARN(WARN_PORTABLE)) @@ -880,7 +880,7 @@ Perl_do_vecset(pTHX_ SV *sv) s[offset+2] = (lval >> 8) & 0xff; s[offset+3] = lval & 0xff; } -#ifdef HAS_QUAD +#ifdef UV_IS_QUAD else if (size == 64) { dTHR; if (ckWARN(WARN_PORTABLE)) diff --git a/hints/aix.sh b/hints/aix.sh index b7cfe46..5fd7547 100644 --- a/hints/aix.sh +++ b/hints/aix.sh @@ -194,7 +194,10 @@ EOM exit 1 ;; esac - ccflags="$ccflags -DUSE_LONG_LONG" + case "$ccflags" in + *-DUSE_LONG_LONG*) ;; + *) ccflags="$ccflags -DUSE_LONG_LONG" ;; + esac ccflags="$ccflags `getconf XBS5_ILP32_OFFBIG_CFLAGS 2>/dev/null`" ldflags="$ldflags `getconf XBS5_ILP32_OFFBIG_LDFLAGS 2>/dev/null`" diff --git a/hints/irix_6.sh b/hints/irix_6.sh index 2c14041..8a0b318 100644 --- a/hints/irix_6.sh +++ b/hints/irix_6.sh @@ -243,7 +243,10 @@ EOM esac case "$ccflags" in *-n32*) - ccflags="$ccflags -DUSE_LONG_LONG" + case "$ccflags" in + *-DUSE_LONG_LONG) ;; + *) ccflags="$ccflags -DUSE_LONG_LONG" ;; + esac archname64="-n32" ;; esac diff --git a/hints/solaris_2.sh b/hints/solaris_2.sh index 9b4f5e2..050cacc 100644 --- a/hints/solaris_2.sh +++ b/hints/solaris_2.sh @@ -350,7 +350,10 @@ EOM ccflags="$ccflags `getconf LFS_CFLAGS`" ldflags="$ldflags `getconf LFS_LDFLAGS`" libswanted="$libswanted `getconf LFS_LIBS`" - ccflags="$ccflags -DUSE_LONG_LONG" + case "$ccflags" in + *-DUSE_LONG_LONG*) ;; + *) ccflags="$ccflags -DUSE_LONG_LONG" ;; + esac # When a 64-bit cc becomes available $archname64 # may need setting so that $archname gets it attached. ;; diff --git a/perl.h b/perl.h index 94bfddb..d25345e 100644 --- a/perl.h +++ b/perl.h @@ -901,104 +901,10 @@ Free_t Perl_mfree (Malloc_t where); --Andy Dougherty August 1996 */ -/* We should be able to get Quad_t in most systems: - all of int64_t, long long, long, int, will work. - - Beware of LP32 systems (ILP32, ILP32LL64). Such systems have been - used to sizeof(long) == sizeof(foo*). This is a bad assumption - because then IV/UV have been 32 bits, too. Which, in turn means - that even if the system has quads (e.g. long long), IV cannot be a - quad. Introducing a 64-bit IV (because of long long existing) - will introduce binary incompatibility. - - Summary: a long long system needs to add -DUSE_LONG_LONG to $ccflags - to get quads -- and if its pointers are still 32 bits, this will break - binary compatibility. Casting an IV (a long long) to a pointer will - truncate half of the IV away. Most systems can just use - Configure -Duse64bits to get the -DUSE_LONG_LONG added either by - their hints files, or directly by Configure if they are using gcc. - - --jhi September 1999 */ - -#if INTSIZE == 4 && LONGSIZE == 4 && PTRSIZE == 4 -# define PERL_ILP32 -# if defined(HAS_LONG_LONG) && LONGLONGSIZE == 8 -# define PERL_ILP32LL64 -# endif -#endif - -#if LONGSIZE == 8 && PTRSIZE == 8 -# define PERL_LP64 -# if INTSIZE == 8 -# define PERL_ILP64 -# endif -#endif - -#ifndef Quad_t -# if LONGSIZE == 8 -# define Quad_t long -# define Uquad_t unsigned long -# define PERL_QUAD_IS_LONG -# endif -#endif - -#ifndef Quad_t -# if INTSIZE == 8 -# define Quad_t int -# define Uquad_t unsigned int -# define PERL_QUAD_IS_INT -# endif -#endif - -#ifndef Quad_t -# ifdef USE_LONG_LONG /* See above note about LP32. --jhi */ -# if defined(HAS_LONG_LONG) && LONGLONGSIZE == 8 -# define Quad_t long long -# define Uquad_t unsigned long long -# define PERL_QUAD_IS_LONG_LONG -# endif -# endif -#endif - -#ifndef Quad_t -# ifdef HAS_INT64_T -# define Quad_t int64_t -# define Uquad_t uint64_t -# define PERL_QUAD_IS_INT64_T -# endif -#endif - -#ifdef Quad_t -# define HAS_QUAD -# ifndef Uquad_t - /* Note that if your Quad_t is a typedef (not a #define) you *MUST* - * have defined by now Uquad_t yourself because 'unsigned type' - * is illegal. */ -# define Uquad_t unsigned Quad_t -# endif -#endif - -#if defined(USE_64_BITS) && defined(HAS_QUAD) -# ifdef PERL_QUAD_IS_LONG /* LP64 */ - typedef long IV; - typedef unsigned long UV; -# else -# ifdef PERL_QUAD_IS_INT /* ILP64 */ - typedef int IV; - typedef unsigned int UV; -# else -# ifdef PERL_QUAD_IS_LONG_LONG /* LL64 */ - typedef long long IV; - typedef unsigned long long UV; -# else -# ifdef PERL_QUAD_IS_INT64_T /* C9X */ - typedef int64_t IV; - typedef uint64_t UV; -# endif -# endif -# endif -# endif -# if defined(PERL_QUAD_IS_INT64_T) && defined(INT64_MAX) +#if defined(USE_64_BITS) && defined(Quad_t) + typedef Quad_t IV; + typedef Uquad_t UV; +# if QUADCASE == 4 && defined(INT64_MAX) /* quad is int64_t */ # define IV_MAX INT64_MAX # define IV_MIN INT64_MIN # define UV_MAX UINT64_MAX @@ -1017,8 +923,8 @@ Free_t Perl_mfree (Malloc_t where); # define IV_IS_QUAD # define UV_IS_QUAD #else - typedef long IV; - typedef unsigned long UV; + typedef long IV; + typedef unsigned long UV; # if defined(INT32_MAX) && LONGSIZE == 4 # define IV_MAX INT32_MAX # define IV_MIN INT32_MIN @@ -1047,6 +953,7 @@ Free_t Perl_mfree (Malloc_t where); # define UVSIZE LONGSIZE # define IVSIZE LONGSIZE #endif + #define IV_DIG (BIT_DIGITS(IVSIZE * 8)) #define UV_DIG (BIT_DIGITS(UVSIZE * 8)) @@ -1355,7 +1262,7 @@ Free_t Perl_mfree (Malloc_t where); # endif #endif -#ifdef HAS_QUAD +#ifdef UV_IS_QUAD # ifdef UQUAD_MAX # define PERL_UQUAD_MAX ((UV)UQUAD_MAX) diff --git a/pp.c b/pp.c index 02fe84a..7d1673c 100644 --- a/pp.c +++ b/pp.c @@ -3254,13 +3254,13 @@ PP(pp_unpack) I16 ashort; int aint; I32 along; -#ifdef HAS_QUAD +#ifdef Quad_t Quad_t aquad; #endif U16 aushort; unsigned int auint; U32 aulong; -#ifdef HAS_QUAD +#ifdef Quad_t Uquad_t auquad; #endif char *aptr; @@ -4018,7 +4018,7 @@ PP(pp_unpack) sv_setpvn(sv, aptr, len); PUSHs(sv_2mortal(sv)); break; -#ifdef HAS_QUAD +#ifdef Quad_t case 'q': along = (strend - s) / sizeof(Quad_t); if (len > along) @@ -4336,7 +4336,7 @@ PP(pp_pack) unsigned int auint; I32 along; U32 aulong; -#ifdef HAS_QUAD +#ifdef Quad_t Quad_t aquad; Uquad_t auquad; #endif @@ -4828,7 +4828,7 @@ PP(pp_pack) } } break; -#ifdef HAS_QUAD +#ifdef Quad_t case 'Q': while (len-- > 0) { fromstr = NEXTFROM; @@ -4843,7 +4843,7 @@ PP(pp_pack) sv_catpvn(cat, (char*)&aquad, sizeof(Quad_t)); } break; -#endif /* HAS_QUAD */ +#endif /* Quad_t */ case 'P': len = 1; /* assume SV is correct length */ /* FALL THROUGH */ diff --git a/pp.h b/pp.h index ec701f3..2ff6f5e 100644 --- a/pp.h +++ b/pp.h @@ -65,7 +65,7 @@ #define POPu ((UV)SvUVx(POPs)) #define POPl ((long)SvIVx(POPs)) #define POPul ((unsigned long)SvIVx(POPs)) -#ifdef HAS_QUAD +#ifdef Quad_t #define POPq ((Quad_t)SvIVx(POPs)) #define POPuq ((Uquad_t)SvUVx(POPs)) #endif @@ -78,7 +78,7 @@ #define TOPu ((UV)SvUV(TOPs)) #define TOPl ((long)SvIV(TOPs)) #define TOPul ((unsigned long)SvUV(TOPs)) -#ifdef HAS_QUAD +#ifdef Quad_t #define TOPq ((Quad_t)SvIV(TOPs)) #define TOPuq ((Uquad_t)SvUV(TOPs)) #endif @@ -125,7 +125,7 @@ #define dPOPiv IV value = POPi #define dTOPuv UV value = TOPu #define dPOPuv UV value = POPu -#ifdef HAS_QUAD +#ifdef Quad_t #define dTOPqv Quad_t value = TOPu #define dPOPqv Quad_t value = POPu #define dTOPuqv Uquad_t value = TOPuq diff --git a/regexec.c b/regexec.c index c51ddee..2d965b0 100644 --- a/regexec.c +++ b/regexec.c @@ -2182,7 +2182,7 @@ S_regmatch(pTHX_ regnode *prog) n = ARG(scan); PL_op = (OP_4tree*)PL_regdata->data[n]; - DEBUG_r( PerlIO_printf(Perl_debug_log, " re_eval 0x%"UVxf"\n", (UV)PL_op) ); + DEBUG_r( PerlIO_printf(Perl_debug_log, " re_eval 0x%"UVxf"\n", PTR2UV(PL_op)) ); PL_curpad = AvARRAY((AV*)PL_regdata->data[n + 2]); PL_regendp[0] = PL_reg_magic->mg_len = locinput - PL_bostr; @@ -3094,7 +3094,7 @@ S_regmatch(pTHX_ regnode *prog) break; default: PerlIO_printf(Perl_error_log, "%"UVxf" %d\n", - (UV)scan, OP(scan)); + PTR2UV(scan), OP(scan)); Perl_croak(aTHX_ "regexp memory corruption"); } scan = next; diff --git a/sv.c b/sv.c index dc09f45..6324ffd 100644 --- a/sv.c +++ b/sv.c @@ -5146,7 +5146,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV /* SIZE */ switch (*q) { -#ifdef HAS_QUAD +#ifdef Quad_t case 'L': /* Ld */ case 'q': /* qd */ intsize = 'q'; @@ -5154,7 +5154,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV break; #endif case 'l': -#ifdef HAS_QUAD +#ifdef Quad_t if (*(q + 1) == 'l') { /* lld */ intsize = 'q'; q += 2; @@ -5264,7 +5264,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV default: iv = va_arg(*args, int); break; case 'l': iv = va_arg(*args, long); break; case 'V': iv = va_arg(*args, IV); break; -#ifdef HAS_QUAD +#ifdef Quad_t case 'q': iv = va_arg(*args, Quad_t); break; #endif } @@ -5276,7 +5276,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV default: iv = (int)iv; break; case 'l': iv = (long)iv; break; case 'V': break; -#ifdef HAS_QUAD +#ifdef Quad_t case 'q': iv = (Quad_t)iv; break; #endif } @@ -5330,7 +5330,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV default: uv = va_arg(*args, unsigned); break; case 'l': uv = va_arg(*args, unsigned long); break; case 'V': uv = va_arg(*args, UV); break; -#ifdef HAS_QUAD +#ifdef Quad_t case 'q': uv = va_arg(*args, Quad_t); break; #endif } @@ -5342,7 +5342,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV default: uv = (unsigned)uv; break; case 'l': uv = (unsigned long)uv; break; case 'V': break; -#ifdef HAS_QUAD +#ifdef Quad_t case 'q': uv = (Quad_t)uv; break; #endif } @@ -5498,7 +5498,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV default: *(va_arg(*args, int*)) = i; break; case 'l': *(va_arg(*args, long*)) = i; break; case 'V': *(va_arg(*args, IV*)) = i; break; -#ifdef HAS_QUAD +#ifdef Quad_t case 'q': *(va_arg(*args, Quad_t*)) = i; break; #endif }