From 638c611796f6bb692e9a4500644d8875adc5c3c8 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 4 Jan 2016 13:03:39 +1300 Subject: [PATCH] pidl: Use PY_SSIZE_T_CLEAN MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This changes the type used for # arguments to PyArg_ParseTupleAndKeywords Signed-off-by: Andrew Bartlett Reviewed-by: Jelmer Vernooij --- pidl/lib/Parse/Pidl/Samba4/Python.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm index 180b6b200899..82f921957427 100644 --- a/pidl/lib/Parse/Pidl/Samba4/Python.pm +++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm @@ -282,7 +282,7 @@ sub PythonStruct($$$$$$) $self->indent; $self->pidl("$cname *object = ($cname *)pytalloc_get_ptr(py_obj);"); $self->pidl("DATA_BLOB blob;"); - $self->pidl("int blob_length = 0;"); + $self->pidl("Py_ssize_t blob_length = 0;"); $self->pidl("enum ndr_err_code err;"); $self->pidl("const char * const kwnames[] = { \"data_blob\", \"allow_remaining\", NULL };"); $self->pidl("PyObject *allow_remaining_obj = NULL;"); @@ -1490,6 +1490,7 @@ sub Parse($$$$$) $self->pidl_hdr(" /* Python wrapper functions auto-generated by pidl */ +#define PY_SSIZE_T_CLEAN 1 /* We use Py_ssize_t for PyArg_ParseTupleAndKeywords */ #include #include \"includes.h\" #include -- 2.34.1