mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
Re-instate backward compatibility by defining Py_CLEAR if it isn't
available.
This commit is contained in:
parent
edf17d8798
commit
2742c5ed63
1 changed files with 14 additions and 0 deletions
|
|
@ -37,6 +37,20 @@ module instead.
|
|||
# define PyMODINIT_FUNC void
|
||||
# endif /* __cplusplus */
|
||||
#endif
|
||||
|
||||
#ifndef Py_CLEAR
|
||||
#define Py_CLEAR(op) \
|
||||
do { \
|
||||
if (op) { \
|
||||
PyObject *tmp = (PyObject *)(op); \
|
||||
(op) = NULL; \
|
||||
Py_DECREF(tmp); \
|
||||
} \
|
||||
} while (0)
|
||||
#endif
|
||||
#ifndef Py_VISIT
|
||||
|
||||
|
||||
/* end 2.2 compatibility macros */
|
||||
|
||||
#define IS_BASESTRING(o) \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue