enum/struct without typedef binding code does not build with C compiler

Bug #247013 reported by mathieu lacage
2
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.

Revision history for this message
Gustavo Carneiro (gjc) wrote :

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'.

Changed in pybindgen:
importance: Undecided → Low
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.