From: Vincent Pit Date: Sat, 5 Jul 2008 13:05:50 +0000 (+0200) Subject: Export the patchlevel with the new VMG_PERL_PATCHLEVEL constant X-Git-Tag: v0.19~3 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=aec8d8c69d06247ad948ef908268a57c27560920;p=perl%2Fmodules%2FVariable-Magic.git Export the patchlevel with the new VMG_PERL_PATCHLEVEL constant --- diff --git a/Magic.xs b/Magic.xs index e0e425c..416bf72 100644 --- a/Magic.xs +++ b/Magic.xs @@ -717,6 +717,7 @@ BOOT: newSVuv(VMG_COMPAT_ARRAY_UNDEF_CLEAR)); newCONSTSUB(stash, "VMG_COMPAT_SCALAR_LENGTH_NOLEN", newSVuv(VMG_COMPAT_SCALAR_LENGTH_NOLEN)); + newCONSTSUB(stash, "VMG_PERL_PATCHLEVEL", newSVuv(VMG_PERL_PATCHLEVEL)); } SV *_wizard(...) diff --git a/lib/Variable/Magic.pm b/lib/Variable/Magic.pm index 9d9e3ae..190102d 100644 --- a/lib/Variable/Magic.pm +++ b/lib/Variable/Magic.pm @@ -191,6 +191,10 @@ True for perls that call 'clear' magic when undefining magical arrays. True for perls that don't call 'len' magic when taking the C of a magical scalar. +=head2 C + +The perl patchlevel this module was built with, or C<0> for non-debugging perls. + =head1 FUNCTIONS =cut @@ -311,7 +315,8 @@ our %EXPORT_TAGS = ( 'funcs' => [ qw/wizard gensig getsig cast getdata dispell/ ], 'consts' => [ qw/SIG_MIN SIG_MAX SIG_NBR MGf_COPY MGf_DUP MGf_LOCAL VMG_UVAR/, qw/VMG_COMPAT_ARRAY_PUSH_NOLEN VMG_COMPAT_ARRAY_UNDEF_CLEAR/, - qw/VMG_COMPAT_SCALAR_LENGTH_NOLEN/ ] + qw/VMG_COMPAT_SCALAR_LENGTH_NOLEN/, + qw/VMG_PERL_PATCHLEVEL/ ] ); our @EXPORT_OK = map { @$_ } values %EXPORT_TAGS; $EXPORT_TAGS{'all'} = [ @EXPORT_OK ]; diff --git a/t/01-import.t b/t/01-import.t index 1524c9f..81e2e3f 100644 --- a/t/01-import.t +++ b/t/01-import.t @@ -3,11 +3,11 @@ use strict; use warnings; -use Test::More tests => 16; +use Test::More tests => 17; require Variable::Magic; -for (qw/wizard gensig getsig cast getdata dispell SIG_MIN SIG_MAX SIG_NBR MGf_COPY MGf_DUP MGf_LOCAL VMG_UVAR VMG_COMPAT_ARRAY_PUSH_NOLEN VMG_COMPAT_ARRAY_UNDEF_CLEAR VMG_COMPAT_SCALAR_LENGTH_NOLEN/) { +for (qw/wizard gensig getsig cast getdata dispell SIG_MIN SIG_MAX SIG_NBR MGf_COPY MGf_DUP MGf_LOCAL VMG_UVAR VMG_COMPAT_ARRAY_PUSH_NOLEN VMG_COMPAT_ARRAY_UNDEF_CLEAR VMG_COMPAT_SCALAR_LENGTH_NOLEN VMG_PERL_PATCHLEVEL/) { eval { Variable::Magic->import($_) }; is($@, '', 'import ' . $_); }