2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-26 06:42:27 +00:00

new boost/python/ssize_t.hpp; avoids potential clash of Py_ssize_t typedef and PY_SSIZE_T_MIN/MAX macros with definitions from other libraries

[SVN r35325]
This commit is contained in:
Ralf W. Grosse-Kunstleve
2006-09-26 00:25:07 +00:00
parent c7fb2f7047
commit c6f2aa4ef2
12 changed files with 166 additions and 30 deletions

View File

@@ -6,6 +6,7 @@
#include <boost/python/object_protocol.hpp>
#include <boost/python/errors.hpp>
#include <boost/python/object.hpp>
#include <boost/python/ssize_t.hpp>
namespace boost { namespace python { namespace api {
@@ -106,7 +107,7 @@ namespace // slicing code copied directly out of the Python implementation
PySequenceMethods *sq = tp->tp_as_sequence;
if (sq && sq->sq_slice && ISINT(v) && ISINT(w)) {
Py_ssize_t ilow = 0, ihigh = PY_SSIZE_T_MAX;
ssize_t ilow = 0, ihigh = ssize_t_max;
if (!_PyEval_SliceIndex(v, &ilow))
return NULL;
if (!_PyEval_SliceIndex(w, &ihigh))
@@ -133,7 +134,7 @@ namespace // slicing code copied directly out of the Python implementation
PySequenceMethods *sq = tp->tp_as_sequence;
if (sq && sq->sq_slice && ISINT(v) && ISINT(w)) {
Py_ssize_t ilow = 0, ihigh = PY_SSIZE_T_MAX;
ssize_t ilow = 0, ihigh = ssize_t_max;
if (!_PyEval_SliceIndex(v, &ilow))
return -1;
if (!_PyEval_SliceIndex(w, &ihigh))