Hello jdv!

Lets see if I got this correctly:

  1. XSUB.h is included in line 745 of pwiz_swigbindings_wrap.cxx, defining typedef struct cv CV and macro XS.
  2. cv.hpp is included in line 1862 of pwiz_swigbindings_wrap.cxx, defining a different struct CV.
  3. the XS macro from Perl is used first in line 2149 of pwiz_swigbindings_wrap.cxx

It is ugly, but the preprocessor can help to move the conflicting identifiers around. To do so I would manually modify the file pwiz_swigbindings_wrap.cxx and insert this line before
#define CV __perl_CV
and these ones after
#undef XSPROTO
#define XSPROTO(name) void name(pTHX_ __perl_CV* cv)
#undef CV
line 745.

I checked this roughly with the following C code:
#define CV __perl_CV /* beginning of include XSUB.h */ struct cv { int i; }; typedef struct cv CV; #define XSPROTO(name) CV name /* end of include XSUB.h */ #undef XSPROTO #define XSPROTO(name) __perl_CV name #undef CV struct CV { char c; }; XSPROTO(x); int main() { struct CV y; x.i = 0; y.c = '!'; return 0; }

In reply to Re: SWIG and conflicting definitions by hexcoder
in thread SWIG and conflicting definitions by jdv

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.