diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-11-03 14:32:13 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-11-03 16:48:04 +0000 |
commit | 7c02b14b5d10a0ba3674a1bad26f97af7adc41ad (patch) | |
tree | 1811b31d044517d67145d9170950663872f6f8ec | |
parent | 066fc6cc186cebdb825117080f3e647214da51bf (diff) |
Fix build with MSVC 19.29.30136
The POSIX type ssize_t was removed. Replace py Py_ssize_t.
Fixes: PYSIDE-1703
Change-Id: I39d7b1df9cff2e9d5ad1290adb5a26745d8e5d24
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit f6cf8edabc76ac18d56a3a5b76e11e4f98df3f47)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | sources/shiboken6/libshiboken/helper.h | 5 | ||||
-rw-r--r-- | sources/shiboken6/libshiboken/signature/signature_helper.cpp | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/sources/shiboken6/libshiboken/helper.h b/sources/shiboken6/libshiboken/helper.h index 8221d68b0..2f4b14444 100644 --- a/sources/shiboken6/libshiboken/helper.h +++ b/sources/shiboken6/libshiboken/helper.h @@ -84,8 +84,9 @@ class AutoArrayPointer AutoArrayPointer &operator=(const AutoArrayPointer &) = delete; AutoArrayPointer &operator=(AutoArrayPointer &&) = delete; - explicit AutoArrayPointer(ssize_t size) { data = new T[size]; } - T &operator[](ssize_t pos) { return data[pos]; } + + explicit AutoArrayPointer(Py_ssize_t size) { data = new T[size]; } + T &operator[](Py_ssize_t pos) { return data[pos]; } operator T *() const { return data; } ~AutoArrayPointer() { delete[] data; } private: diff --git a/sources/shiboken6/libshiboken/signature/signature_helper.cpp b/sources/shiboken6/libshiboken/signature/signature_helper.cpp index d27ddeabb..4a2130a9d 100644 --- a/sources/shiboken6/libshiboken/signature/signature_helper.cpp +++ b/sources/shiboken6/libshiboken/signature/signature_helper.cpp @@ -223,7 +223,7 @@ static PyObject *_build_new_entry(PyObject *new_name, PyObject *value) PyObject *new_value = PyDict_Copy(value); PyObject *multi = PyDict_GetItem(value, PyName::multi()); if (multi != nullptr && Py_TYPE(multi) == &PyList_Type) { - ssize_t len = PyList_Size(multi); + Py_ssize_t len = PyList_Size(multi); AutoDecRef list(PyList_New(len)); if (list.isNull()) return nullptr; @@ -301,7 +301,7 @@ PyObject *_address_to_stringlist(PyObject *numkey) * When needed in `PySide_BuildSignatureProps`, the strings are * finally materialized. */ - ssize_t address = PyNumber_AsSsize_t(numkey, PyExc_ValueError); + Py_ssize_t address = PyNumber_AsSsize_t(numkey, PyExc_ValueError); if (address == -1 && PyErr_Occurred()) return nullptr; char **sig_strings = reinterpret_cast<char **>(address); |