From 35ff0adf2b8a086cad257f8e50962ca379f81c92 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Wed, 30 Sep 2009 12:35:54 +0000 Subject: [PATCH] boost/python: some Py_ssize_t replaced with boost::python::ssize_t to restore compatibility with Python 2.3 and 2.4 [SVN r56491] --- include/boost/python/list.hpp | 2 +- src/list.cpp | 4 ++-- src/object/class.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/boost/python/list.hpp b/include/boost/python/list.hpp index e3dbf711..10fd40fd 100644 --- a/include/boost/python/list.hpp +++ b/include/boost/python/list.hpp @@ -19,7 +19,7 @@ namespace detail { void append(object_cref); // append object to end - Py_ssize_t count(object_cref value) const; // return number of occurrences of value + ssize_t count(object_cref value) const; // return number of occurrences of value void extend(object_cref sequence); // extend list by appending sequence elements diff --git a/src/list.cpp b/src/list.cpp index de54335e..77e61688 100644 --- a/src/list.cpp +++ b/src/list.cpp @@ -144,11 +144,11 @@ void list_base::sort(object_cref cmpfunc) // For some reason, moving this to the end of the TU suppresses an ICE // with vc6. -Py_ssize_t list_base::count(object_cref value) const +ssize_t list_base::count(object_cref value) const { object result_obj(this->attr("count")(value)); #if PY_VERSION_HEX >= 0x03000000 - Py_ssize_t result = PyLong_AsSsize_t(result_obj.ptr()); + ssize_t result = PyLong_AsSsize_t(result_obj.ptr()); #else long result = PyInt_AsLong(result_obj.ptr()); #endif diff --git a/src/object/class.cpp b/src/object/class.cpp index 3e29693b..febfdf58 100644 --- a/src/object/class.cpp +++ b/src/object/class.cpp @@ -355,7 +355,7 @@ namespace objects PyObject* d = type_->tp_dict; PyObject* instance_size_obj = PyObject_GetAttrString(d, const_cast("__instance_size__")); - Py_ssize_t instance_size = instance_size_obj ? + ssize_t instance_size = instance_size_obj ? #if PY_VERSION_HEX >= 0x03000000 PyLong_AsSsize_t(instance_size_obj) : 0; #else