From: Vincent Pit Date: Mon, 28 Dec 2009 21:40:08 +0000 (+0100) Subject: Fix expected constness for utf8_length() arguments X-Git-Tag: v0.40~8 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=93186ef8908c59933e872554a0e2ef66ce040db0;p=perl%2Fmodules%2FVariable-Magic.git Fix expected constness for utf8_length() arguments --- 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