diff options
Diffstat (limited to 'Include')
-rw-r--r-- | Include/Python.h | 2 | ||||
-rw-r--r-- | Include/cpython/object.h | 2 | ||||
-rw-r--r-- | Include/pybuffer.h (renamed from Include/buffer.h) | 4 |
3 files changed, 5 insertions, 3 deletions
diff --git a/Include/Python.h b/Include/Python.h index 5416b04..5bc8cc6 100644 --- a/Include/Python.h +++ b/Include/Python.h @@ -39,6 +39,7 @@ #include "pymacro.h" #include "pymath.h" #include "pymem.h" +#include "pybuffer.h" #include "object.h" #include "objimpl.h" #include "typeslots.h" @@ -50,7 +51,6 @@ #include "longobject.h" #include "cpython/longintrepr.h" #include "boolobject.h" -#include "buffer.h" #include "floatobject.h" #include "complexobject.h" #include "rangeobject.h" diff --git a/Include/cpython/object.h b/Include/cpython/object.h index 2ee97ba..6cc3d72 100644 --- a/Include/cpython/object.h +++ b/Include/cpython/object.h @@ -2,8 +2,6 @@ # error "this header file must not be included directly" #endif -#include "buffer.h" // for Py_buffer, included after PyObject has been defined - PyAPI_FUNC(void) _Py_NewReference(PyObject *op); #ifdef Py_TRACE_REFS diff --git a/Include/buffer.h b/Include/pybuffer.h index 6893505..31795b7 100644 --- a/Include/buffer.h +++ b/Include/pybuffer.h @@ -17,6 +17,10 @@ extern "C" { * */ +// Forward declaration to be able to include pybuffer.h before object.h: +// pybuffer.h uses PyObject and object.h uses Py_buffer. +typedef struct _object PyObject; + typedef struct { void *buf; PyObject *obj; /* owned reference */ |