mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
bpo-35059: Add _PyObject_CAST() macro (GH-10645)
Add _PyObject_CAST() and _PyVarObject_CAST() macros to cast argument to PyObject* and PyVarObject* properly.
This commit is contained in:
parent
271753a27a
commit
2ff8fb7639
5 changed files with 29 additions and 23 deletions
|
@ -42,7 +42,7 @@ static inline void _PyObject_GC_TRACK_impl(const char *filename, int lineno,
|
|||
}
|
||||
|
||||
#define _PyObject_GC_TRACK(op) \
|
||||
_PyObject_GC_TRACK_impl(__FILE__, __LINE__, (PyObject *)(op))
|
||||
_PyObject_GC_TRACK_impl(__FILE__, __LINE__, _PyObject_CAST(op))
|
||||
|
||||
/* Tell the GC to stop tracking this object.
|
||||
*
|
||||
|
@ -70,7 +70,7 @@ static inline void _PyObject_GC_UNTRACK_impl(const char *filename, int lineno,
|
|||
}
|
||||
|
||||
#define _PyObject_GC_UNTRACK(op) \
|
||||
_PyObject_GC_UNTRACK_impl(__FILE__, __LINE__, (PyObject *)(op))
|
||||
_PyObject_GC_UNTRACK_impl(__FILE__, __LINE__, _PyObject_CAST(op))
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue