diff options
author | Nicholas Clark <nick@ccl4.org> | 2013-09-11 12:12:25 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2013-09-17 13:57:52 +0200 |
commit | 1640b983ff7c1296873ae4dc0e2163160c853cb3 (patch) | |
tree | 1f2a305a871cfb523c7d7c83a3e5875746a1ba1d /pp_pack.c | |
parent | b002c7b1f7eb7c6fa27e84405047d34581195270 (diff) | |
download | perl-1640b983ff7c1296873ae4dc0e2163160c853cb3.tar.gz |
Use IVSIZE not HAS_QUAD to enable 'q' and 'Q' formats in pack.
Whilst the code for 'q' and 'Q' in pp_pack is itself well behaved if enabled
on a perl with 32 bit IVs (using SvNV instead of SvIV and SvUV), the
regression tests are not. Several tests use an eval of "pack 'q'" to
determine if 64 bit integer support is available (instead of
$Config{ivsize}), and t/op/pack.t fails many tests. While these could be
fixed (or skipped), unfortunately the approach of evaling "pack 'q'" is
fairly popular on CPAN, so the breakage isn't just in the perl core, and
might also be present in code we can't see or submit patches for.
Diffstat (limited to 'pp_pack.c')
-rw-r--r-- | pp_pack.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1632,7 +1632,7 @@ S_unpack_rec(pTHX_ tempsym_t* symptr, const char *s, const char *strbeg, const c PUSHs(newSVpvn_flags(aptr, len, SVs_TEMP)); } break; -#ifdef HAS_QUAD +#if IVSIZE >= 8 case 'q': while (len-- > 0) { Quad_t aquad; @@ -1659,7 +1659,7 @@ S_unpack_rec(pTHX_ tempsym_t* symptr, const char *s, const char *strbeg, const c cuv += auquad; } break; -#endif /* HAS_QUAD */ +#endif /* float and double added gnb@melba.bby.oz.au 22/11/89 */ case 'f': while (len-- > 0) { @@ -2982,7 +2982,7 @@ S_pack_rec(pTHX_ SV *cat, tempsym_t* symptr, SV **beglist, SV **endlist ) PUSH32(utf8, cur, &ai32, needs_swap); } break; -#ifdef HAS_QUAD +#if IVSIZE >= 8 case 'Q': while (len-- > 0) { Uquad_t auquad; @@ -2999,7 +2999,7 @@ S_pack_rec(pTHX_ SV *cat, tempsym_t* symptr, SV **beglist, SV **endlist ) PUSH_VAR(utf8, cur, aquad, needs_swap); } break; -#endif /* HAS_QUAD */ +#endif case 'P': len = 1; /* assume SV is correct length */ GROWING(utf8, cat, start, cur, sizeof(char *)); |