From 818896dec204a23a6bed43c00c68b36dcde9dcb7 Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Wed, 17 Sep 2014 16:12:40 +0000 Subject: [PATCH] fix a portability problem with the Python binding (found by Prasanth) --- src/runtime/python/pypgf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/runtime/python/pypgf.c b/src/runtime/python/pypgf.c index d31c3e77e..e1df97cd1 100644 --- a/src/runtime/python/pypgf.c +++ b/src/runtime/python/pypgf.c @@ -1,3 +1,4 @@ +#define PY_SSIZE_T_CLEAN #include #include "structmember.h" @@ -6,7 +7,6 @@ #include #include #include -#include static PyObject* PGFError; @@ -2681,7 +2681,7 @@ pgf_readPGF(PyObject *self, PyObject *args) static ExprObject* pgf_readExpr(PyObject *self, PyObject *args) { - size_t len; + Py_ssize_t len; const uint8_t *buf; if (!PyArg_ParseTuple(args, "s#", &buf, &len)) return NULL; @@ -2711,7 +2711,7 @@ pgf_readExpr(PyObject *self, PyObject *args) { static TypeObject* pgf_readType(PyObject *self, PyObject *args) { - size_t len; + Py_ssize_t len; const uint8_t *buf; if (!PyArg_ParseTuple(args, "s#", &buf, &len)) return NULL;