From: Nicholas Clark Date: Wed, 19 Jan 2005 21:22:30 +0000 (+0000) Subject: Make "assertion" attribute code and test conditional X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=77c9267e79d87625158fdecaa27a5ce308c517ba;p=p5sagit%2Fp5-mst-13.2.git Make "assertion" attribute code and test conditional p4raw-id: //depot/perl@23827 --- diff --git a/t/op/attrs.t b/t/op/attrs.t index dc91438..2169e3c 100644 --- a/t/op/attrs.t +++ b/t/op/attrs.t @@ -8,7 +8,7 @@ BEGIN { require './test.pl'; } -plan tests => 95; +plan 'no_plan'; $SIG{__WARN__} = sub { die @_ }; @@ -147,7 +147,8 @@ eval 'my $$foo : bar = 1'; like $@, qr/Can't declare scalar dereference in my/; -my @code = qw(assertion lvalue locked method); +my @code = qw(lvalue locked method); +unshift @code, 'assertion' if $] >= 5.009; my @other = qw(shared unique); my %valid; $valid{CODE} = {map {$_ => 1} @code}; diff --git a/xsutils.c b/xsutils.c index 2dc0d7a..c09a376 100644 --- a/xsutils.c +++ b/xsutils.c @@ -71,6 +71,7 @@ modify_SV_attributes(pTHX_ SV *sv, SV **retlist, SV **attrlist, int numattrs) switch (SvTYPE(sv)) { case SVt_PVCV: switch ((int)len) { +#ifdef CVf_ASSERTION case 9: if (memEQ(name, "assertion", 9)) { if (negated) @@ -80,6 +81,7 @@ modify_SV_attributes(pTHX_ SV *sv, SV **retlist, SV **attrlist, int numattrs) continue; } break; +#endif case 6: switch (name[3]) { case 'l':