summaryrefslogtreecommitdiff
path: root/pyuno
diff options
context:
space:
mode:
authorMatthew J. Francis <mjay.francis@gmail.com>2015-06-30 10:07:23 -0400
committerMatthew Francis <mjay.francis@gmail.com>2015-07-01 04:18:48 +0000
commit3a6ec53eeeec71312f5ea890689f9c2ee79c2aac (patch)
tree728a98502155890e00273452a6d11d51ca610789 /pyuno
parent9394362e10de6fe30e673efcdbe56d43579447b1 (diff)
Fix compilation with Python 2.7
Change-Id: I0dd118f0215e06fec0cccff9b46d80f13bd802cc Reviewed-on: https://gerrit.libreoffice.org/16620 Reviewed-by: Matthew Francis <mjay.francis@gmail.com> Tested-by: Matthew Francis <mjay.francis@gmail.com>
Diffstat (limited to 'pyuno')
-rw-r--r--pyuno/source/module/pyuno.cxx8
-rw-r--r--pyuno/source/module/pyuno_impl.hxx7
2 files changed, 7 insertions, 8 deletions
diff --git a/pyuno/source/module/pyuno.cxx b/pyuno/source/module/pyuno.cxx
index 8f7a6a67e19a..413cc20c227e 100644
--- a/pyuno/source/module/pyuno.cxx
+++ b/pyuno/source/module/pyuno.cxx
@@ -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;
- 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)
return -1;
diff --git a/pyuno/source/module/pyuno_impl.hxx b/pyuno/source/module/pyuno_impl.hxx
index 5f0df95efaea..11fbfa27e73f 100644
--- a/pyuno/source/module/pyuno_impl.hxx
+++ b/pyuno/source/module/pyuno_impl.hxx
@@ -143,13 +143,6 @@ inline PyObject* PyStrBytes_FromStringAndSize(const char *string, Py_ssize_t len
}
#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
{