From: Jarkko Hietaniemi Date: Sat, 13 Nov 1999 16:26:13 +0000 (+0000) Subject: Continue largefileness separation from quadness; X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1eeb0f31cd73d85a0db15ba3ace4e4d1691c4226;p=p5sagit%2Fp5-mst-13.2.git Continue largefileness separation from quadness; move nv-preserving test out of perl.h into Configure; use HAS_SETVBUF in IO. p4raw-id: //depot/cfgperl@4560 --- diff --git a/Configure b/Configure index 0a0523e..26bc1f2 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 Sat Nov 13 15:36:41 EET 1999 [metaconfig 3.0 PL70] +# Generated on Sat Nov 13 17:55:50 EET 1999 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.com) cat >/tmp/c1$$ <&4 ;; + 8) echo "(Your off_t is 64 bits, so you could use that.)" ;; esac fi $rm -f try.* try @@ -8603,7 +8603,7 @@ else val="$undef" echo "No, it doesn't." case "$fpossize" in - 8) echo "(This is okay because your fpos_t is 64 bits wide.)" >&4 ;; + 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;; esac fi $rm -f try.* try @@ -8653,6 +8653,9 @@ esac : see if fseeko exists set fseeko d_fseeko eval $inlibc +case "$longsize" in +8) echo "(Your long is 64 bits, so in a pinch you could use fseek.)" ;; +esac : see if fsetpos exists set fsetpos d_fsetpos @@ -8676,6 +8679,9 @@ eval $inlibc : see if ftello exists set ftello d_ftello eval $inlibc +case "$longsize" in +8) echo "(Your long is 64 bits, so in a pinch you could use ftell.)" ;; +esac : see if getgrent exists set getgrent d_getgrent @@ -9601,7 +9607,12 @@ case "$quadtype" in esac d_quad="$undef" ;; -*) echo "We could use '$quadtype' for 64-bit integers." >&4 +*) 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 diff --git a/config_h.SH b/config_h.SH index fb35932..8dca72a 100644 --- a/config_h.SH +++ b/config_h.SH @@ -2473,9 +2473,6 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- /* U64SIZE: * This symbol contains the sizeof(U64). */ -/* NVSIZE: - * This symbol contains the sizeof(NV). - */ #define IVTYPE $ivtype /**/ #define UVTYPE $uvtype /**/ #define I8TYPE $i8type /**/ @@ -2501,7 +2498,6 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- #define I64SIZE $i64size /**/ #define U64SIZE $u64size /**/ #endif -#define NVSIZE $nvsize /**/ /* IVdf: * This symbol defines the format string used for printing a Perl IV diff --git a/ext/IO/IO.xs b/ext/IO/IO.xs index e614cff..e5ce83d 100644 --- a/ext/IO/IO.xs +++ b/ext/IO/IO.xs @@ -357,8 +357,7 @@ setvbuf(handle, buf, type, size) int type int size CODE: -/* Should check HAS_SETVBUF once Configure tests for that */ -#if defined(PERLIO_IS_STDIO) && defined(_IOFBF) +#if defined(PERLIO_IS_STDIO) && defined(_IOFBF) && defined(HAS_SETVBUF) if (!handle) /* Try input stream. */ handle = IoIFP(sv_2io(ST(0))); if (handle) diff --git a/hints/solaris_2.sh b/hints/solaris_2.sh index a5d033b..7de55f7 100644 --- a/hints/solaris_2.sh +++ b/hints/solaris_2.sh @@ -339,7 +339,7 @@ EOCBU lflibs="`getconf LFS_LIBS 2>/dev/null|sed -e 's@^-l@@' -e 's@ -l@ @g`" case "$lfcflags$lfldflags$lflibs" in '');; -*) ccflags="$ccflags $lfcflags" +*) ccflags="$ccflags -DUSE_LONG_LONG $lfcflags" ldflags="$ldflags $ldldflags" libswanted="$libswanted $lflibs" ;; diff --git a/perl.h b/perl.h index 8ef429c..3bcc032 100644 --- a/perl.h +++ b/perl.h @@ -1848,27 +1848,6 @@ struct svtbl { #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) -/* The correct way: a Configure test where (UV)~0 is cast to NV and back. */ -/* Believe. */ -#define IV_FITS_IN_NV -/* Doubt. */ -#if defined(USE_LONG_DOUBLE) && \ - defined(LDBL_MANT_DIG) && IV_DIG >= LDBL_MANT_DIG -# undef IV_FITS_IN_NV -#else -# if defined(DBL_MANT_DIG) && IV_DIG >= DBL_MANT_DIG -# undef IV_FITS_IN_NV -# else -# if IV_DIG >= NV_DIG -# undef IV_FITS_IN_NV -# else -# if IVSIZE >= NVSIZE -# undef IV_FITS_IN_NV -# endif -# endif -# endif -#endif - /* Used with UV/IV arguments: */ /* XXXX: need to speed it up */ #define CLUMP_2UV(iv) ((iv) < 0 ? 0 : (UV)(iv)) diff --git a/pp_sys.c b/pp_sys.c index 2dc9ebf..b7c2cd0 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -1592,10 +1592,10 @@ PP(pp_send) djSP; dMARK; dORIGMARK; dTARGET; GV *gv; IO *io; - STRLEN offset; + Off_t offset; SV *bufsv; char *buffer; - STRLEN length; + Off_t length; STRLEN blen; MAGIC *mg; @@ -1618,7 +1618,11 @@ PP(pp_send) goto say_undef; bufsv = *++MARK; buffer = SvPV(bufsv, blen); +#if Off_t_SIZE > IVSIZE + length = SvNVx(*++MARK); +#else length = SvIVx(*++MARK); +#endif if (length < 0) DIE(aTHX_ "Negative length"); SETERRNO(0,0); @@ -1634,7 +1638,11 @@ PP(pp_send) } else if (PL_op->op_type == OP_SYSWRITE) { if (MARK < SP) { +#if Off_t_SIZE > IVSIZE + offset = SvNVx(*++MARK); +#else offset = SvIVx(*++MARK); +#endif if (offset < 0) { if (-offset > blen) DIE(aTHX_ "Offset outside string");