develooper Front page | perl.perl5.porters | Postings from November 2000

Re: INTERFACE and INTERFACE_MACRO explanation

Thread Previous
From:
Jarkko Hietaniemi
Date:
November 7, 2000 18:44
Subject:
Re: INTERFACE and INTERFACE_MACRO explanation
Message ID:
20001107204343.A3967@chaos.wustl.edu
On Fri, Oct 13, 2000 at 10:59:19AM +1100, Brendan O'Dea wrote:
> On Thu, Oct 12, 2000 at 02:58:23PM +0100, Nick Ing-Simmons wrote:
> >Brendan O'Dea <bod@compusol.com.au> writes:
> >>
> >>INTERFACE_MACRO allows you to use a different method to extract/store
> >>the C function pointer than the defaults of XSINTERFACE_FUNC and
> >>XSINTERFACE_FUNC_SET as seen above.
> >>
> >>This mechanism appears to work in 5.005, but doesn't compile under 5.6.0
> >>as the current CV is not visible within XS_Foo_whatever as `cv'.
> >
> >It cannot be too different though as Tk's scheme (which is similar
> >but less automated) works fine with 5.6.0
> 
> OK wrong guess :-)  The compiler (gcc 2.95.2) was producing:
> 
>   Foo.c: In function `XS_Foo_whatever':
>   Foo.c:38: parse error before `cv'
>   ...
> 
> although the `cv' it is complaining about in this case is in the cast of
> (int (*cv)()) producted by the XSINTERFACE_FUNC macro.
> 
> This may be corrected by changing the definition in XSUB.h:
> 
> -#define XSINTERFACE_FUNC(ret,cv,f)      ((XSINTERFACE_CVT(ret,cv))(f))
> +#define XSINTERFACE_FUNC(ret,cv,f)      ((XSINTERFACE_CVT(ret,))(f))
> 
> which I note is how 5.005 had it.

Care to produce a combined patch for perlxs.pod that would explain
the INTERFACE a little bit better plus the above fix?
 
-- 
$jhi++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About