From: Peter Rabbitson Date: Sat, 29 Dec 2012 09:03:25 +0000 (+0100) Subject: Introduce 5.16/5.17 support X-Git-Tag: v0.03~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d20da7cf1e348e270e568da11c1e0f7974ac2329;p=p5sagit%2FDevel-PeekPoke.git Introduce 5.16/5.17 support --- diff --git a/Changes b/Changes index 65b8ab7..410667c 100644 --- a/Changes +++ b/Changes @@ -1,4 +1,5 @@ - Fix incorrect operation on some OSes (cygwin) when ptrsize < ivsize + - Extend support to 5.16.x (RT#76444) 0.02 2012-03-20 09:45 (UTC) diff --git a/lib/Devel/PeekPoke/PP.pm b/lib/Devel/PeekPoke/PP.pm index 9b6370f..7e79b56 100644 --- a/lib/Devel/PeekPoke/PP.pm +++ b/lib/Devel/PeekPoke/PP.pm @@ -14,6 +14,7 @@ use B (); # for B::PV use constant { _MAX_ADDR => 'FF' x PTR_SIZE, _PERLVERSION => "$]", # we do not support every perl, as we rely on the implementation of SV/SvPV + _PERLVERSION_MIN => ($] =~ /^5\.(\d{3})/)[0], }; sub _pack_address { @@ -32,8 +33,8 @@ sub _pack_address { BEGIN { # we know we start from 5.8.1 - if ( (_PERLVERSION =~ /^5\.(\d{3})/)[0] % 2 ) { - die "@{[ __PACKAGE__ ]} does not function on development perl versions (by design)\n"; + if (_PERLVERSION_MIN == 9 ) { + die "@{[ __PACKAGE__ ]} does not function on 5.@{[_PERLVERSION_MIN]}_xxx development perls (by design)\n"; } elsif (_PERLVERSION < 5.010) { constant->import({ @@ -42,7 +43,7 @@ BEGIN { _XPV_ADDR_OFFSET => undef, # it isn't really undefined, we just do not care }); } - elsif (_PERLVERSION < 5.016) { + elsif (_PERLVERSION < 5.018) { # The xpv address is written to the svu_pv, however we may get in trouble # due to padding/alignment when ivsize (thus svu) is larger than PTR_SIZE constant->import( _XPV_IN_SVU_OFFSET => $Config{ivsize} == PTR_SIZE ? 0 : do { @@ -74,7 +75,7 @@ BEGIN { }); } else { - # do not take any chanes with not-yet-released perls - things may change + # do not take any chances with not-yet-released perls - things may change die "@{[ __PACKAGE__ ]} does not *yet* support this perl $], please file a bugreport (it is very very easy to fix)\n"; } }