Kaydet (Commit) 3a6ec53e authored tarafından Matthew J. Francis's avatar Matthew J. Francis Kaydeden (comit) Matthew Francis

Fix compilation with Python 2.7

Change-Id: I0dd118f0215e06fec0cccff9b46d80f13bd802cc
Reviewed-on: https://gerrit.libreoffice.org/16620Reviewed-by: 's avatarMatthew Francis <mjay.francis@gmail.com>
Tested-by: 's avatarMatthew Francis <mjay.francis@gmail.com>
üst 9394362e
...@@ -338,7 +338,13 @@ int lcl_PySlice_GetIndicesEx( PyObject *pObject, sal_Int32 nLen, sal_Int32 *nSta ...@@ -338,7 +338,13 @@ int lcl_PySlice_GetIndicesEx( PyObject *pObject, sal_Int32 nLen, sal_Int32 *nSta
{ {
Py_ssize_t nStart_ssize, nStop_ssize, nStep_ssize, nSliceLength_ssize; Py_ssize_t nStart_ssize, nStop_ssize, nStep_ssize, nSliceLength_ssize;
int nResult = PySlice_GetIndicesEx( static_cast<PySliceObject_t*>(pObject), nLen, &nStart_ssize, &nStop_ssize, &nStep_ssize, &nSliceLength_ssize ); int nResult = PySlice_GetIndicesEx(
#if PY_VERSION_HEX >= 0x030200f0
pObject,
#else
reinterpret_cast<PySliceObject*>(pObject),
#endif
nLen, &nStart_ssize, &nStop_ssize, &nStep_ssize, &nSliceLength_ssize );
if (nResult == -1) if (nResult == -1)
return -1; return -1;
......
...@@ -143,13 +143,6 @@ inline PyObject* PyStrBytes_FromStringAndSize(const char *string, Py_ssize_t len ...@@ -143,13 +143,6 @@ inline PyObject* PyStrBytes_FromStringAndSize(const char *string, Py_ssize_t len
} }
#endif /* PY_MAJOR_VERSION >= 3 */ #endif /* PY_MAJOR_VERSION >= 3 */
// Type of argument to PySlice_GetIndicesEx() changed in Python 3.2
#if PY_VERSION_HEX >= 0x030200f0
typedef PyObject PySliceObject_t;
#else
typedef PySliceObject PySliceObject_t;
#endif
namespace pyuno namespace pyuno
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment