[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: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.

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.

Graham.


Follow-Ups from:
Tim Bunce <Tim.Bunce@ig.co.uk>
Tye McQueen <tye@metronet.com>
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>

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