[PATCH] Fix python_access on 64bits hosts
Julien ÉLIE
julien at trigofacile.com
Sun Oct 31 23:12:39 UTC 2010
Hi Raphaël,
> /* Make "s#" use Py_ssize_t rather than int. */
> #define PY_SSIZE_T_CLEAN
>
> /* Define Py_ssize_t when it does not exist (Python < 2.5.0). */
> #if PY_VERSION_HEX < 0x02050000
> typedef int Py_ssize_t;
> #endif
>
> /* Python.h must be included after having defined PY_SSIZE_T_CLEAN. */
> #include "Python.h"
You will of course have noticed that #include "Python.h" must occur
before the typedef. Otherwise, there is a redefinition of Py_ssize_t,
which triggers an error off.
I have just successfully compiled the new code with both Python 2.4.6
and Python 2.7 on a 32-bit architecture, using "make warnings".
I hope it also works fine on your 64-bit system.
Have a nice week-end,
--
Julien ÉLIE
« Sol lucet omnibus. »
More information about the inn-workers
mailing list