On 2010/5/25 Dirk Eddelbuettel wrote:
>
> Denis,
>
> On 25 May 2010 at 11:56, Denis Barbier wrote:
> | According to
> |   http://www.python.org/dev/peps/pep-3123/
> | the attached patch should work.  I have tested that python-rpy2

> | compiles, but do not know whether it works fine.
>
> Wow, that would be a good catch.  I guess Laurent may have been unaware too.
>
> I just applied the three-line patch -- but it does not work:
[...]

Here is a revised patch against rpy2 2.1.2.  It builds fine with
python2.5 and python2.6, but I do not know how to test it.
Regards,

Denis
--- rpy2-2.1.2.orig/rpy/rinterface/rpy_rinterface.h
+++ rpy2-2.1.2/rpy/rinterface/rpy_rinterface.h
@@ -25,7 +25,7 @@
 typedef Py_ssize_t (*charbufferproc)(PyObject *, Py_ssize_t, char **);
 #endif
 #if (PY_VERSION_HEX < 0x02060000)
-typedef Py_SIZE Py_Size;
+#define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
 #endif
 
 

Reply via email to