Improve how/when we define Py_ssize_t to match the way the python developers
recommend, so that it works if the user includes headers from something like numpy which also defines Py_ssize_t. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9546 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
267d327fd8
commit
b0fe47a4dd
1 changed files with 5 additions and 2 deletions
|
|
@ -79,7 +79,10 @@ PyObject *PyBool_FromLong(long ok)
|
|||
#endif
|
||||
|
||||
/* Py_ssize_t for old Pythons */
|
||||
#if PY_VERSION_HEX < 0x02050000
|
||||
/* This code is as recommended by: */
|
||||
/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */
|
||||
#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
|
||||
typedef int Py_ssize_t;
|
||||
# define PY_SSIZE_T_MAX INT_MAX
|
||||
# define PY_SSIZE_T_MIN INT_MIN
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue