From: Dagfinn Ilmari Mannsåker Date: Fri, 8 Aug 2014 21:49:09 +0000 (+0100) Subject: Switch from Newz to Newxz X-Git-Tag: v0.09~10^2~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bcbff2c187f54108e900e55bab0706b10965e6ab;p=p5sagit%2FSub-Name.git Switch from Newz to Newxz Provide back-compat macro for pre-5.10 perls --- diff --git a/Name.xs b/Name.xs index 5d36d14..31dbde4 100644 --- a/Name.xs +++ b/Name.xs @@ -18,6 +18,9 @@ static MGVTBL subname_vtbl; #define SvMAGIC_set(sv, val) (SvMAGIC(sv) = (val)) #endif +#ifndef Newxz +#define Newxz(ptr, num, type) Newz(0, ptr, num, type) +#endif MODULE = Sub::Name PACKAGE = Sub::Name @@ -71,7 +74,7 @@ subname(name, sub) while (mg && mg->mg_virtual != &subname_vtbl) mg = mg->mg_moremagic; if (!mg) { - Newz(702, mg, 1, MAGIC); + Newxz(mg, 1, MAGIC); mg->mg_moremagic = SvMAGIC(cv); mg->mg_type = PERL_MAGIC_ext; mg->mg_virtual = &subname_vtbl;