[perl #39855] [CAGE] configuration: define MIN/MAX macros for all integral typedefs

Christoph Otto via RT parrotbug-followup at parrotcode.org
Sun Apr 19 09:23:26 UTC 2009


On Sat Apr 18 05:45:59 2009, julianalbo wrote:
> >> It's great to have INTVAL and UINTVAL, but without MAX_INTVAL it's
> kind of
> >> hard to work with them in some respects.  All integral typedefs
> should
> > have
> >> min/max macros.  Syntax not a big deal, it can be fixed later, just
> don't
> >> break anything when introducing them.
> >
> > Nothing has happened on this ticket since it was introduced in 2006.
> Do
> > we need MIN/MAX macros?  If so, why, or where do we expect them to
> be used?
> 
> The current intended names for that macros are PARROT_INTVAL_MAX,
> PARROT_INTVAL_MIN, and so on.
> 
> The last work in this matter is: include/parrot/platform_limits.h
> 

It looks like those comments in platform_limits.h are out-of-place. 
PARROT_INTVAL_MIN and PARROT_INTVAL_MAX are defined in
include/parrot/config.h, although the definition may not be as flexible
as the macros in perl.h that Nicholas mentioned.  It might be beneficial
to incorporate them into what we're currently using, but I'm not a good
judge of that.

The definitions in parrot's config.h come, as one would expect, from
config/auto/format.pm.  (TT #530 addresses this.)  It should be pretty
simple to add the code needed to figure out which macros to use for the
missing min/max values.  The min/max are currently defined for INTVAL
and FLOATVAL, so definitions are needed for UINTVAL, HUGEINTVAL,
UHUGEINTVAL and HUGEFLOATVAL.  Once those are in place, this ticket can
go away.


More information about the parrot-dev mailing list