Skip to content

Commit

Permalink
Add Python increment and decrement wrappers
Browse files Browse the repository at this point in the history
  • Loading branch information
wsfulton committed Mar 24, 2024
1 parent 8d2aca6 commit e43e3eb
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Lib/python/pyhead.swg
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,16 @@ SWIG_Python_str_FromChar(const char *c)
# define PyList_SET_ITEM PyList_SetItem
# define PySliceObject PyObject
#endif

/* Increment and Decrement wrappers - for portability when using the stable abi and for performance otherwise */
#ifdef Py_LIMITED_API
# define SWIG_Py_INCREF Py_IncRef
# define SWIG_Py_XINCREF Py_IncRef
# define SWIG_Py_DECREF Py_DecRef
# define SWIG_Py_XDECREF Py_DecRef
#else
# define SWIG_Py_INCREF Py_INCREF
# define SWIG_Py_XINCREF Py_XINCREF
# define SWIG_Py_DECREF Py_DECREF
# define SWIG_Py_XDECREF Py_XDECREF
#endif

0 comments on commit e43e3eb

Please sign in to comment.