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. >
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4