Re: [pygccxml-development] Loss of typedef in generated code
Brought to you by:
mbaas,
roman_yakovenko
From: Patrick H. <pat...@pr...> - 2007-12-18 17:04:50
|
On Dec 18, 2007, at 1:24 AM, Roman Yakovenko wrote: > On Dec 17, 2007 10:35 PM, Ben Schleimer <bsc...@lu...> > wrote: >> Since gccxml first preprocesses the C++ code before building the AST >> tree, the short answer is probably no. > > You right, this is exactly what happens. > >> However, I imagine if you did something clever like: >> union myUint64 { >> #if defined(WIN32) >> UINT64 val; >> #else >> Uint64_t val; >> #endif >> }; >> >> You might be able to save your typing info. > > No, this will not work, because Py++ doesn't support unions. Also > newer version of pygccxml and Py++ will not help in this specific > situation. The latest SVN version contains few improvements in this > area. For example instead of vector< X, std::allocator< X > > Py++ in > many cases will generate vector< X >. I found out, that the definition > of some STL containers is different between GCC and MSVC. > > How big is your project? Do you use myUint64 in all your code without > exceptions? This is the first time that this has cropped up as far as I know. The actual type is OSG::UInt64 which comes from OpenSG, a large software package upon which ours depends. It is possible that OSG::UInt64 could start being used more in the future because our code is using 64-bit values as unique identifiers for data objects. > If so, I guess it will be safe to run "search and replace" > algorithm on generated code. You can achieve this by "replacing" > code_creator_t.create method ( > http://language-binding.net/pyplusplus/documentation/apidocs/pyplusplus.code_creators.code_creator-pysrc.html#code_creator_t.create > ) Thanks for the pointer. I will look into this. -Patrick -- Patrick L. Hartling Senior Software Engineer, Priority 5 http://www.priority5.com/ |