ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl5-porters
perl5-porters
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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved