in reply to Re^2: perlxs INTERFACE problem
in thread perlxs INTERFACE problem

Ok I think I have the solution. It appears to be a combination of my compiler and my XSUB.h file (which I guess is really a statement of my perl version 5.6.1)

So 5.6.1 defines the macro that extracts the C function to call for a particular invocation of the perl interface something to the effect of this: (I expanded some of the macros for clarity)

XSFUNCTION = ((ret (*cv)())(XSANY.dptr));

Of course the cast shown above grossly violates the C standard for abstract declarators (no identifiers should be present, a.k.a. "cv"). The reason for this is because the header is reusing the same code that declares XSFUNCTION (which needs an identifier). cc barfs when it reaches the cast.

I took a look at the XSUB.h in 5.8.8, and sure enough it's been corrected to not include an identifier. I must not be the first person with this problem :)

If you are unfortunate enough to not be able to upgrade your version of perl for some reason and you still need or want to get this to work here's what you can add at the beginning of your XS file to fix things:

#undef XSINTERFACE_FUNC #define XSINTERFACE_FUNC(ret,cv,f) ((ret (*)())(f))

And that's all folks. Thanks for the advice :)