--- Compress-LZF/LZF.xs 2001/09/27 18:36:34 1.1 +++ Compress-LZF/LZF.xs 2001/09/27 19:51:26 1.3 @@ -10,6 +10,9 @@ static STRLEN nolen_na; # define SvPV_nolen(sv) SvPV ((sv), nolen_na) #endif +#if PATCHLEVEL < 6 +# define call_sv perl_call_sv +#endif #include "lzf_c.c" #include "lzf_d.c" @@ -187,7 +190,11 @@ static void need_storable(void) { +#if PATCHLEVEL < 6 + perl_eval_pv ("require Storable;", 1); +#else load_module (PERL_LOADMOD_NOIMPORT, newSVpv ("Storable", 0), Nullsv); +#endif storable_mstore = GvCV (gv_fetchpv ("Storable::mstore" , TRUE, SVt_PVCV)); storable_mretrieve = GvCV (gv_fetchpv ("Storable::mretrieve", TRUE, SVt_PVCV)); @@ -218,7 +225,9 @@ PROTOTYPE: $ PPCODE: - if (SvROK (sv)) /* mstore */ + if (SvTYPE(sv) != SVt_IV + && SvTYPE(sv) != SVt_NV + && SvTYPE(sv) != SVt_PV) /* mstore */ { if (!storable_mstore) need_storable ();