Re: [PATCH] API for the internals
by Zefram other posts by this author
Nov 4 2009 9:05AM messages near this date
Re: [PATCH] API for the internals
|
Re: [PATCH] API for the internals
demerphq wrote:
> We already do.
I ran into PAD_MAX having changed between 5.8.8 and 5.8.9. Now, that
constant wasn't even defined in a header, it's only defined in pad.c, but
the value is effectively part of the pad API. That's one of the things
that's currently considered non-public, but seriously needs a public API.
(The module in question is Lexical::Var, and I ended up with this logic:
static PADOFFSET pad_max(void)
{
#if PERL_VERSION_GE(5,9,5)
return I32_MAX;
#elif PERL_VERSION_GE(5,9,0)
return 999999999;
#elif PERL_VERSION_GE(5,8,0)
static PADOFFSET max;
if(!max) {
SV *versv = get_sv("]", 0);
char *verp = SvPV_nolen(versv);
max = strGE(verp, "5.008009") ? I32_MAX : 999999999;
}
return max;
#else /* <5.8.0 */
return 999999999;
#endif /* <5.8.0 */
}
Fun, eh.)
-zefram
Thread:
Gerard Goossen
Andy Dougherty
Gerard Goossen
Nicholas Clark
Demerphq
Zefram
Nicholas Clark
Zefram
Nicholas Clark
Gerard Goossen
Nicholas Clark
Nicholas Clark
|