X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=ext%2Fattrs%2Fattrs.xs;h=53ba5354e2358f72359d06e54a45fdf321097076;hb=c5be433b5c5658093bc9cae4434721a0b63e7a85;hp=dae612adafe33fa22cdb0062a9e672114a9bf76d;hpb=f0f333f45536802923a359d930d1dcfd5b4589ea;p=p5sagit%2Fp5-mst-13.2.git diff --git a/ext/attrs/attrs.xs b/ext/attrs/attrs.xs index dae612a..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" @@ -24,10 +25,11 @@ char * Class int i; CV *cv; PPCODE: - if (!compcv || !(cv = CvOUTSIDE(compcv))) + 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), 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, 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)));