[GCC-XML]__int64 support for mscv6

Jody Winston josephwinston at mac.com
Fri Mar 21 08:57:25 EST 2003


Given the following header file, foo.h:

#ifdef WIN32  // NT does not support 64 bit integers.
typedef __int64 Int64;
typedef unsigned __int64 UInt64;
#else
typedef signed long long int Int64;
typedef unsigned long long int UInt64;
#endif

namespace vUtl
{
   void setNoValue(Int64& i);
   void setNoValue(UInt64& i);
}

With gccxml:

$ gccxml --print
GCC-XML version 0.4.1
Configuration settings:
  GCCXML_CONFIG="c:/Program Files/GCC_XML/config"
  GCCXML_COMPILER="cl"
  GCCXML_CXXFLAGS=""
  GCCXML_EXECUTABLE="c:/Program Files/GCC_XML/gccxml_cc1plus.exe"
  GCCXML_FLAGS="-quiet -o /dev/null -nostdinc -I- -w -fsyntax-only
-D__stdcall= -D__cdecl= -D_stdcall= -D_cdecl= -D__declspec(x)=
-D_inline=inline -D__uuidof(x)=IID() -D__int64='long long'
-D__cplusplus -D_MSC_VER=1200 -D_MSC_EXTENSIONS -D_WIN32 -D_M_IX86
-D_WCHAR_T_DEFINED -DPASCAL= -DRPC_ENTRY= -DSHSTDAPI=HRESULT
-DSHSTDAPI_(x)=x -I"c:/Program Files/GCC_XML/Vc6/Include"
-I"C:/Program Files/Microsoft Visual Studio/VC98/Include" "
  GCCXML_USER_FLAGS=""
  GCCXML_ROOT="c:/Program Files/GCC_XML"

Produces the following xml when run as follows:
$ gccxml -DWIN32 foo.h  -fxml=foo.xml

<?xml version="1.0"?>
<GCC_XML>
  <Namespace id="_1" name="::" members="_3 _5 _7 "/>
  <Namespace id="_2" name="std" context="_1" members=""/>
  <Namespace id="_3" name="vUtl" context="_1" members="_8 _9 "/>
  <FundamentalType id="_4" name="long long unsigned int"/>
  <Typedef id="_5" name="UInt64" type="_4" context="_1" location="f0:3"/>
  <FundamentalType id="_6" name="long long int"/>
  <Typedef id="_7" name="Int64" type="_6" context="_1" location="f0:2"/>
  <Function id="_8" name="setNoValue" returns="_10" context="_3" location="f0:12
" extern="1">
    <Argument type="_11"/>
  </Function>
  <Function id="_9" name="setNoValue" returns="_10" context="_3" location="f0:11
" extern="1">
    <Argument type="_12"/>
  </Function>
  <FundamentalType id="_10" name="void"/>
  <ReferenceType id="_11" type="_4"/>
  <ReferenceType id="_12" type="_6"/>
  <File id="f0" name="foo.h"/>
</GCC_XML>

Since __int64 is defined to be 'long long' by gccxml, all occurrences of
__int64 are replaces with 'long long'.  This generated xml is
incorrect since when WIN32 is defined Int64 should be __int64 and
UInt64 should be unsigned __int64.

Can this problem be fixed by removing __int64 from GCCXML_FLAGS?

Thanks,

Jody Winston



More information about the gccxml mailing list