summaryrefslogtreecommitdiff
path: root/Include/weakrefobject.h
diff options
context:
space:
mode:
Diffstat (limited to 'Include/weakrefobject.h')
-rw-r--r--Include/weakrefobject.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/Include/weakrefobject.h b/Include/weakrefobject.h
index f15c9d9c12..725838726d 100644
--- a/Include/weakrefobject.h
+++ b/Include/weakrefobject.h
@@ -12,6 +12,7 @@ typedef struct _PyWeakReference PyWeakReference;
/* PyWeakReference is the base struct for the Python ReferenceType, ProxyType,
* and CallableProxyType.
*/
+#ifndef Py_LIMITED_API
struct _PyWeakReference {
PyObject_HEAD
@@ -27,7 +28,7 @@ struct _PyWeakReference {
/* A cache for wr_object's hash code. As usual for hashes, this is -1
* if the hash code isn't known yet.
*/
- long hash;
+ Py_hash_t hash;
/* If wr_object is weakly referenced, wr_object has a doubly-linked NULL-
* terminated list of weak references to it. These are the list pointers.
@@ -37,6 +38,7 @@ struct _PyWeakReference {
PyWeakReference *wr_prev;
PyWeakReference *wr_next;
};
+#endif
PyAPI_DATA(PyTypeObject) _PyWeakref_RefType;
PyAPI_DATA(PyTypeObject) _PyWeakref_ProxyType;
@@ -62,9 +64,11 @@ PyAPI_FUNC(PyObject *) PyWeakref_NewProxy(PyObject *ob,
PyObject *callback);
PyAPI_FUNC(PyObject *) PyWeakref_GetObject(PyObject *ref);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(Py_ssize_t) _PyWeakref_GetWeakrefCount(PyWeakReference *head);
PyAPI_FUNC(void) _PyWeakref_ClearRef(PyWeakReference *self);
+#endif
#define PyWeakref_GET_OBJECT(ref) (((PyWeakReference *)(ref))->wr_object)