summaryrefslogtreecommitdiffstats
path: root/contrib/perl5/ext/attrs/attrs.xs
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/perl5/ext/attrs/attrs.xs')
-rw-r--r--contrib/perl5/ext/attrs/attrs.xs9
1 files changed, 7 insertions, 2 deletions
diff --git a/contrib/perl5/ext/attrs/attrs.xs b/contrib/perl5/ext/attrs/attrs.xs
index 7f7970d..4c00cd7 100644
--- a/contrib/perl5/ext/attrs/attrs.xs
+++ b/contrib/perl5/ext/attrs/attrs.xs
@@ -1,3 +1,4 @@
+#define PERL_NO_GET_CONTEXT
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
@@ -26,6 +27,10 @@ char * Class
PPCODE:
if (!PL_compcv || !(cv = CvOUTSIDE(PL_compcv)))
croak("can't set attributes outside a subroutine scope");
+ if (ckWARN(WARN_DEPRECATED))
+ Perl_warner(aTHX_ WARN_DEPRECATED,
+ "pragma \"attrs\" is deprecated, "
+ "use \"sub NAME : ATTRS\" instead");
for (i = 1; i < items; i++) {
STRLEN n_a;
char *attr = SvPV(ST(i), n_a);
@@ -55,7 +60,7 @@ SV * sub
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)));
OpenPOWER on IntegriCloud