Skip to content

Commit

Permalink
Use boost::python::ssize_t instead of Py_ssize_t - it is available fo…
Browse files Browse the repository at this point in the history
…r all PY_VERSION_HEX.
  • Loading branch information
JohannesWilde committed Dec 14, 2024
1 parent c641a80 commit 4a0c096
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/boost/python/numpy/dtype.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class BOOST_NUMPY_DECL dtype : public object {
template <typename T> static dtype get_builtin();

/// @brief Return the size of the data type in bytes.
Py_ssize_t get_itemsize() const;
boost::python::ssize_t get_itemsize() const;

/**
* @brief Compare two dtypes for equivalence.
Expand Down
2 changes: 1 addition & 1 deletion src/numpy/dtype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ python::detail::new_reference dtype::convert(object const & arg, bool align)
return python::detail::new_reference(reinterpret_cast<PyObject*>(obj));
}

Py_ssize_t dtype::get_itemsize() const {
boost::python::ssize_t dtype::get_itemsize() const {
#if NPY_ABI_VERSION < 0x02000000
return reinterpret_cast<PyArray_Descr*>(ptr())->elsize;
#else
Expand Down

0 comments on commit 4a0c096

Please sign in to comment.