[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

Re: New way to do XS constants



On Fri, Jan 07, 2000 at 11:56:24AM +0000, Graham Barr wrote:
> On Fri, Jan 07, 2000 at 11:18:04AM +0000, Tim Bunce wrote:
> > On Fri, Jan 07, 2000 at 10:08:12AM +0000, Graham Barr wrote:
> > > Take a look at the end of IO.xs
> > 
> >         newCONSTSUB(stash,"POLLPRI", newSViv(POLLPRI));
> 
> Oh, and another benefit is that you can do runtime checks that the constants
> exist. For example in IO-Tty I do
> 
> #ifdef B110
>         newCONSTSUB(stash,"B110", newSViv(B110));
> #else
>         av_push(export_fail, newSVpv("B110",4));
> #endif
> 
> So that the import of B110 will fail if it does not exist.

Great. I'm glad to see someone using @EXPORT_FAIL as intended at last.

> But all of this requires entering long-hand. I think the original
> question was to get xsubpp to help out a bit, which I think would
> be a good idea.

Agreed.

Tim.


References to:
Tye McQueen <tye@metronet.com>
Tim Bunce <Tim.Bunce@ig.co.uk>
Graham Barr <gbarr@pobox.com>
Tim Bunce <Tim.Bunce@ig.co.uk>
Graham Barr <gbarr@pobox.com>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]