X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=Magic.xs;h=f64d001f5efef803452f63eb2cc4ae0280885708;hb=93186ef8908c59933e872554a0e2ef66ce040db0;hp=e55503a9d64991e68971152b1d016f6feb96b700;hpb=ca8e318c303fb28fc36f25ea16842cd768b4c52d;p=perl%2Fmodules%2FVariable-Magic.git diff --git a/Magic.xs b/Magic.xs index e55503a..f64d001 100644 --- a/Magic.xs +++ b/Magic.xs @@ -104,10 +104,6 @@ STATIC SV *vmg_clone(pTHX_ SV *sv, tTHX owner) { # define mPUSHu(U) PUSHs(sv_2mortal(newSVuv(U))) #endif -#ifndef SvPV_const -# define SvPV_const SvPV -#endif - #ifndef PERL_MAGIC_ext # define PERL_MAGIC_ext '~' #endif @@ -988,7 +984,11 @@ STATIC U32 vmg_svt_len(pTHX_ SV *sv, MAGIC *mg) { PUSHs(mg->mg_obj ? mg->mg_obj : &PL_sv_undef); if (t < SVt_PVAV) { STRLEN l; - const U8 *s = (const U8 *) SvPV_const(sv, l); +#if VMG_HAS_PERL(5, 9, 2) + const U8 *s = SvPV_const(sv, l); +#else + U8 *s = SvPV(sv, l); +#endif if (DO_UTF8(sv)) len = utf8_length(s, s + l); else