Hello jdv!
Lets see if I got this correctly:
- XSUB.h is included in line 745 of pwiz_swigbindings_wrap.cxx, defining typedef struct cv CV and macro XS.
- cv.hpp is included in line 1862 of pwiz_swigbindings_wrap.cxx, defining a different struct CV.
- 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;
}