[Samba] Difficulty compiling 4.0.0alpha11 on RHEL 5, "Py_ssize_t" undeclared in net.c

Jelmer Vernooij jelmer at samba.org
Sun Aug 22 14:29:59 MDT 2010


On Sun, 2010-08-22 at 22:19 +0200, Matthias Dieter Wallnöfer wrote:
> Jelmer,
> 
> should we apply this patch?
Yes - we're already doing similar things in a lot of other files and the
code generated by pidl.

Cheers,

Jelmer

> Michael Wood wrote:
> >> --- samba-4.0.0alpha11/source4/utils/net/net.c.oldpython        2010-01-11
> >> 00:35:28.000000000 -0500
> >> +++ samba-4.0.0alpha11/source4/utils/net/net.c  2010-08-22
> >> 11:44:59.000000000 -0400
> >> @@ -52,6 +52,15 @@
> >>   #include<Python.h>
> >>   #include "scripting/python/modules.h"
> >>
> >> +/* Py_ssize_t for old Pythons */
> >> +/* This code is as recommended by: */
> >> +/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */
> >> +#if PY_VERSION_HEX<  0x02050000&&  !defined(PY_SSIZE_T_MIN)
> >> +typedef int Py_ssize_t;
> >> +# define PY_SSIZE_T_MAX INT_MAX
> >> +# define PY_SSIZE_T_MIN INT_MIN
> >> +#endif
> >> +
> >>   static PyObject *py_tuple_from_argv(int argc, const char *argv[])
> >>   {
> >>         PyObject *l;
> >>      
> 



More information about the samba-technical mailing list