Fix python2 build with clang 15

PyUnicode_AsUTF8AndSize is only available in python3.
This commit is contained in:
jca 2023-01-10 13:22:30 +00:00
parent bad92ab48e
commit 3ef48655d6
2 changed files with 2 additions and 2 deletions

View File

@ -6,7 +6,7 @@ GH_COMMIT= 206bca0b90f5780815c0b6c6cbccfd03f27f6985
DISTNAME= rcsparse-20151027
PKGNAME= py-${DISTNAME}
REVISION= 3
REVISION= 4
CATEGORIES= devel

View File

@ -10,13 +10,13 @@ Index: py-rcsparse.c
+#define PyString_CheckExact PyUnicode_CheckExact
+#define PyString_FromString PyUnicode_FromString
+#define PyString_FromStringAndSize PyUnicode_FromStringAndSize
+#endif
+
+static void
+_PyUnicode_AsUTF8AndSize(PyObject *obj, char **strp, Py_ssize_t *sizep)
+{
+ *strp = PyUnicode_AsUTF8AndSize(obj, sizep);
+}
+#endif
+
static PyObject *
rcstoken2pystr(struct rcstoken *tok)