Re: [pygccxml-development] Loss of typedef in generated code
Brought to you by:
mbaas,
roman_yakovenko
From: Roman Y. <rom...@gm...> - 2007-12-18 07:24:16
|
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? 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 ) -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |