libvigra/libvigra-1.11.1-python-3.7.patch

20 lines
778 B
Diff

diff -u -r vigra-1.11.1/vigranumpy/src/core/vigranumpycore.cxx vigra-1.11.1-py3.7/vigranumpy/src/core/vigranumpycore.cxx
--- vigra-1.11.1/vigranumpy/src/core/vigranumpycore.cxx 2017-05-19 17:01:08.000000000 +0200
+++ vigra-1.11.1-py3.7/vigranumpy/src/core/vigranumpycore.cxx 2018-07-29 18:29:46.514547076 +0200
@@ -59,10 +59,14 @@
Py_ssize_t size = PyUnicode_GET_DATA_SIZE(s.ptr());
const char * data = PyUnicode_AS_DATA(s.ptr());
return checksum(data, size);
-#else
+#elif (PY_MAJOR_VERSION == 3) && (PY_MINOR_VERSION < 7)
Py_ssize_t size = 0;
char * data = PyUnicode_AsUTF8AndSize(s.ptr(), &size);
return checksum(data, size);
+#else
+ Py_ssize_t size = 0;
+ const char * data = PyUnicode_AsUTF8AndSize(s.ptr(), &size);
+ return checksum(data, size);
#endif
}