File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,22 +26,24 @@ extern "C" {
2626
2727
2828// bpo-42262 added Py_NewRef() to Python 3.10.0a3
29- #if PY_VERSION_HEX < 0x030a00A3
30- static inline PyObject * Py_NewRef (PyObject * obj )
29+ #if PY_VERSION_HEX < 0x030a00A3 && !defined( Py_NewRef )
30+ static inline PyObject * _Py_NewRef (PyObject * obj )
3131{
3232 Py_INCREF (obj );
3333 return obj ;
3434}
35+ #define Py_NewRef (obj ) _Py_NewRef(_PyObject_CAST(obj))
3536#endif
3637
3738
3839// bpo-42262 added Py_XNewRef() to Python 3.10.0a3
39- #if PY_VERSION_HEX < 0x030a00A3
40- static inline PyObject * Py_XNewRef (PyObject * obj )
40+ #if PY_VERSION_HEX < 0x030a00A3 && !defined( Py_XNewRef )
41+ static inline PyObject * _Py_XNewRef (PyObject * obj )
4142{
4243 Py_XINCREF (obj );
4344 return obj ;
4445}
46+ #define Py_XNewRef (obj ) _Py_XNewRef(_PyObject_CAST(obj))
4547#endif
4648
4749
You can’t perform that action at this time.
0 commit comments