[GCC-XML] Preprocessor problem with gccxml

Johannes Brunen jbrunen at datasolid.de
Mon May 4 10:57:54 EDT 2009


I'm new to this list and would like to report a problem I'm facing on
using gccxml.

Below you can see a simple C++ header file extract which compiles fine
on msvc 9. It is verbose but part of a C++ library package I would like
to wrap using py++.

#if defined( THIS_FUNCTION )

#if defined( PARENT_FUNCTION )

#if defined( DECL_FUNCTION )

#define IS_() is_
#define IS_THIS_FUNCTION(name) IS_()name

#define THIS_FUNCTION(name) THIS()name
#define PARENT_FUNCTION(name) PARENT()name
#define decl_() DECL_
#define DECL_FUNCTION(lib) decl_()lib

#define ENTITY_IS( name, lib ) \
DECL_FUNCTION(lib) logical IS_THIS_FUNCTION(name) (const ENTITY*);

#define ENTITY_IS_PROTOTYPE( name, lib ) \
class name; \
ENTITY_IS( name, lib )


After preprocessing on msvc9 I got the following code:

class ENTITY; DECL_KERN logical is_ENTITY (const ENTITY*);

After preprocessing with gccxml with this command
gccxml.exe main.hxx -fxml=... --gccxml-compiler msvc9 -E
I got a similiar but false output.

class ENTITY; DECL_ KERN logical is_ ENTITY (const ENTITY*);

The problem is obvisouly. Unintended spaces are introduces between the
tokens. My question is if there is any workaround so that the
preprocessor stage results in the same output?

With best regards,
Johannes Brunen

More information about the gccxml mailing list