My error, sorry. I should have said to put the line

#define CV __perl_CV

before this one

#include "perl.h"

otherwise it looks ok.

Update: some explanations added

What I intend to do, is this:

  1. for the processing of perl.h, XSUB.h and the included header files therein, substitute the offending identifier CV by __perl_CV. This is done by the preprocessor directive #define CV __perl_CV
  2. Afterwards redeclare the macro XSPROTO, which was using CV also. Unfortunately the above substitution affects only C code, but not subsequent preprocessor directives, so we need to adjust this macro definition.
    This is done by first deleting the old macro definition (#undef XSPROTO), and then by defining it again, but this time with __perl_CV instead of CV.
  3. Finally delete the substitution for identifier CV (#undef CV, so that the following code can use it exclusively.
  4. This in total should remove the conflict between the two different definitions of CV by using __perl_CV for the first one instead.

If you are curious, you can look at the difference of the preprocessed outputs with and without the modification (gcc -E -dDfile should produce them).


In reply to Re^3: 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.