[GCC-XML] Simulate g++ with gcc-xml under Windows ?

Brad King brad.king at kitware.com
Tue Mar 22 09:20:13 EST 2005


Nicolas Hognon wrote:
> Hello,
> 
> I come back with a question about the possibilty to simulate compiler
> with gcc-xml, because I think I have missed something.
> 
> For exemple I have the following code:
> 
> #if defined(VK_COMPILER_MSVC)
> 	typedef	signed __int8		int8;	// 8-bit signed integer.
> 	typedef	signed __int16		int16;	// 16-bit signed integer.
> #elif defined(VK_COMPILER_GCC)
> 	typedef	int8_t				int8;	// 8-bit signed integer.
> 	typedef	int16_t				int16;	// 16-bit signed integer.
> #elif defined(VK_COMPILER_CODEWARRIOR)
> 	typedef	signed char			int8;	// 8-bit signed integer.
> 	typedef	signed short		int16;	// 16-bit signed integer.
> #endif
> 
> Where the VK_* are defined using the presence of _MSC_VER, __MWERKS__, __GNUC__.
> Even if I set the "good defines" with the GCCXML_CXXFLAGS options
> gcc-xml need to know types that are defined in system header files. In
> this exemple the codewarrior part does not use specific types but it
> can be the case. In the "share" folder in gcc-xml there a "gccxml-0.6"
> folder with a "gccxml-config" file and folders containing system
> header files for different compiler. So how can I force gcc-xml to use
> my set of header files as system header files ?

The _MSC_VER and similar preprocessor definitions are set in the 
GCCXML_FLAGS configuration setting.  Run gccxml --print to see the 
options being used to simulate a compiler.  Usually GCCXML_FLAGS is set 
automaticaly to a value that simulates the compiler specified.  You need 
to REPLACE the value of GCCXML_FLAGS, not GCCXML_CXXFLAGS, in order to 
change the simulated compiler to something not supported currently.

> Another question about the support of msvc compiler. __int8, __int16,
> __int32, __int64 are microsoft specific types but does not seems to be
> supported by gcc-xml when it is emulating msvc71. The problem is those
> types does not seems to be defined in any header file (they are
> internal types of msvc I think).

The type __int64 is supported by defining it as a macro to "long long". 
  Similar macros could be added for the other types.

-Brad



More information about the gccxml mailing list