# 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
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