From 77b6aa7358b846d151425b20654e1490ed30b538 Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Fri, 23 Feb 2024 15:40:28 -0500 Subject: [PATCH] IECoreBinding : Use `Py_ssize_t` MSVC has `SSIZE_T`, but not `ssize_t`, which is not part of the standard it seems. Python's `pyport.h` file does a `typedef` for it, but something must have changed between Python `3.7` and `3.10` that causes that to not be included from what we're using. It does seem that the official recommendation is to use `Py_ssize_t` now. --- include/IECorePython/IECoreBinding.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/IECorePython/IECoreBinding.h b/include/IECorePython/IECoreBinding.h index a45803a16c..eb3a4265f0 100644 --- a/include/IECorePython/IECoreBinding.h +++ b/include/IECorePython/IECoreBinding.h @@ -79,9 +79,9 @@ IECOREPYTHON_API std::string repr( T &x ); /// For backwards compatibility with older versions of boost, /// which don't provide boost::python::len -IECOREPYTHON_API inline ssize_t len( const boost::python::object &obj ) +IECOREPYTHON_API inline Py_ssize_t len( const boost::python::object &obj ) { - ssize_t result = PyObject_Length( obj.ptr() ); + Py_ssize_t result = PyObject_Length( obj.ptr() ); if( PyErr_Occurred() ) {