From: Kalyanov D. <kal...@gm...> - 2008-11-27 22:18:08
|
SWIG generates bindings for nested structures by taking their source code, and feeding the modified code back to the parser (renaming structures, classes and unions and removing SWIG directives). Modification of code is done using a simple strstr() function call to look for classes and replacing some text after them. This is incorrect. Example for this: struct A { struct B { /*struct*/ struct { int a; } b; }; }; After modification, the following code for inner (anonymous) struct is fed to the parser: /*struct { int a; } b; Comment is not closed, and parse fails. Proposed patch fixes this by stripping comments before renaming structures. |