yet more cleanups of the PERL_OBJECT, MULTIPLICITY and USE_THREADS
[p5sagit/p5-mst-13.2.git] / ext / attrs / attrs.xs
index dae612a..53ba535 100644 (file)
@@ -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)));