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 :)


In reply to Re^3: perlxs INTERFACE problem by Fiftyvolts
in thread perlxs INTERFACE problem by Fiftyvolts

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.