1 --- src/pythoninlua.c.orig 2011-07-23 17:25:28.552430739 +0600
2 +++ src/pythoninlua.c 2011-07-23 17:27:32.973047569 +0600
4 #include "pythoninlua.h"
5 #include "luainpython.h"
7 +/* Py_ssize_t introduced as index type in Python 2.5 (PEP 353) */
8 +#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
9 +typedef int Py_ssize_t;
10 +#define PY_SSIZE_T_MAX INT_MAX
11 +#define PY_SSIZE_T_MIN INT_MIN
14 static int py_asfunc_call(lua_State *L);
16 static int py_convert_custom(lua_State *L, PyObject *o, int asindx)
18 lua_pushboolean(L, 0);
19 } else if (PyString_Check(o)) {
23 PyString_AsStringAndSize(o, &s, &len);
24 lua_pushlstring(L, s, len);
32 PyString_AsStringAndSize(repr, &s, &len);
33 lua_pushlstring(L, s, len);