enum/struct without typedef binding code does not build with C compiler
Bug #247013 reported by
mathieu lacage
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
PyBindGen |
Confirmed
|
Low
|
Unassigned |
Bug Description
C header:
struct MyStruct
{
int a;
};
python script:
mod = Module ()
mod.add_class ('MyStruct')
mod.generate (sys.stdout)
generated code:
typedef struct {
PyObject_HEAD
MyStruct *obj;
} PyMyStruct;
This code is valid C++ code but is not valid C code: there is a struct keyword missing.
To post a comment you must log in.
I am finding it hard to fix this. I am unable to get the information I need from pygccxml. Clearly I cannot always use 'struct Foo' because of the case 'typedef struct {...} Foo'.