X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=ext%2Fattrs%2Fattrs.xs;h=53ba5354e2358f72359d06e54a45fdf321097076;hb=c5be433b5c5658093bc9cae4434721a0b63e7a85;hp=da952d5a3f1a40ec977ad0a287bac239d05ed4b8;hpb=6b88bc9c1f6d4b32c70e7ef68f8c65266e431623;p=p5sagit%2Fp5-mst-13.2.git diff --git a/ext/attrs/attrs.xs b/ext/attrs/attrs.xs index da952d5..53ba535 100644 --- a/ext/attrs/attrs.xs +++ b/ext/attrs/attrs.xs @@ -1,3 +1,4 @@ +#define PERL_NO_GET_CONTEXT #include "EXTERN.h" #include "perl.h" #include "XSUB.h" @@ -27,7 +28,8 @@ char * Class if (!PL_compcv || !(cv = CvOUTSIDE(PL_compcv))) croak("can't set attributes outside a subroutine scope"); for (i = 1; i < items; i++) { - char *attr = SvPV(ST(i), PL_na); + STRLEN n_a; + char *attr = SvPV(ST(i), n_a); cv_flags_t flag = get_flag(attr); if (!flag) croak("invalid attribute name %s", attr); @@ -47,13 +49,14 @@ SV * sub sub = Nullsv; } else { - char *name = SvPV(sub, PL_na); + STRLEN n_a; + char *name = SvPV(sub, n_a); sub = (SV*)perl_get_cv(name, FALSE); } if (!sub) croak("invalid subroutine reference or name"); if (CvFLAGS(sub) & CVf_METHOD) - XPUSHs(sv_2mortal(newSVpv("method", 0))); + XPUSHs(sv_2mortal(newSVpvn("method", 6))); if (CvFLAGS(sub) & CVf_LOCKED) - XPUSHs(sv_2mortal(newSVpv("locked", 0))); + XPUSHs(sv_2mortal(newSVpvn("locked", 6)));