[Python-Dev] Forward declaration of PyObject* values
Scott Gilbert
xscottg at yahoo.com
Wed Aug 13 14:15:59 EDT 2003
More information about the Python-Dev mailing list
Wed Aug 13 14:15:59 EDT 2003
- Previous message: [Python-Dev] Forward declaration of PyObject* values
- Next message: [Python-Dev] Forward declaration of PyObject* values
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I used the following for a similar task: #ifndef PyObject_HEAD struct _object; typedef _object PyObject; #endif Some compilers won't like the incomplete type on the struct, but it looks like you're using GCC which should be fine. Since PyObject_HEAD is defined in object.h, you won't be redefining it if the actual file is really included. This is probably fragile, but so is using a leading underscore in a user defined type, or having a name as generic as _object at the global scope. It works for now at least. --- Tom Emerson <tree at basistech.com> wrote: > > [...] I would like to forward declare PyObject so it can be used as an > opaque type in these interfaces, and only have Python.h included in > those source files that actually need it. >
- Previous message: [Python-Dev] Forward declaration of PyObject* values
- Next message: [Python-Dev] Forward declaration of PyObject* values
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list