[GCC-XML] Re: [C++-sig] pyste, gccxml and boost ublas, random number generator etc
Brad King
brad.king at kitware.com
Mon Aug 1 09:39:09 EDT 2005
Nicodemus wrote:
> Stefan Seefeld wrote:
>
>> Could anybody with gccxml and windows experience detail the problem a
>> bit ?
>> While I plan to look into a new synopsis-based pyste frontend, I don't
>> quite
>> understand the problem, as the compiler emulation code synopsis uses was
>> to a certain degree inspired by gccxml, and so I would assume that gccxml
>> does the right thing, no matter the platform.
>>
>>
>
> I will quote Brad King, the creator of GCCXML, from the gccxml list in a
> thread regarding this problem (hope he does not mind):
>
> "As I said the GCC parser cannot always handle the results of
> preprocessing as if using VC7.1. In the case of system headers the
> GCC-XML installation copies and patches them to fix the problems. In
> this case all the VC-specific hacks in boost are confusing GCC-XML."
>
> Hopefully Brad can shed some more light in a possible workaround. :)
The easiest way to deal with this is to think of GCC-XML as yet another
compiler. Just like code has #ifdef directives to deal with differences
between compilers it can also test for the definition of __GCCXML__.
This macro is the only way to tell apart GCC-XML from the simulated
compiler at preprocessing time. You can use it in cases when the
intended work-around is for the parser and not the standard library:
#if defined(_MSC_VER) && _MSC_VER < 1300
// MSVC 6 extension syntax
#else
// Standard syntax
#endif
might become
#if defined(_MSC_VER) && _MSC_VER < 1300 && !defined(__GCCXML__)
// MSVC 6 extension syntax
#else
// Standard syntax
#endif
-Brad
More information about the gccxml
mailing list