python: Define Py_ssize_t if the Python library doesn't.
authorJelmer Vernooij <jelmer@samba.org>
Tue, 23 Dec 2008 10:25:06 +0000 (11:25 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Tue, 23 Dec 2008 10:26:31 +0000 (11:26 +0100)
source4/lib/ldb/pyldb.c
source4/param/pyparam.c

index a60307c9eb2c58098df7ef88dfe87bc16d225562..f4f43a3d0b25384b693a5f72fe02ed909f0e4c0f 100644 (file)
 #include "ldb_includes.h"
 #include "pyldb.h"
 
+/* There's no Py_ssize_t in 2.4, apparently */
+#if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 5
+typedef int Py_ssize_t;
+typedef inquiry lenfunc;
+#endif
+
 /* Picked out of thin air. To do this properly, we should probably have some part of the 
  * errors in LDB be allocated to bindings ? */
 #define LDB_ERR_PYTHON_EXCEPTION       142
index acadcc08b07f14605b95eef86b9f3a2d5497c72c..69c2613a0994276319cc21ff38192682ff21ba73 100644 (file)
 #include "param/loadparm.h"
 #include "pytalloc.h"
 
+/* There's no Py_ssize_t in 2.4, apparently */
+#if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 5
+typedef int Py_ssize_t;
+typedef inquiry lenfunc;
+#endif
+
 #define PyLoadparmContext_AsLoadparmContext(obj) py_talloc_get_ptr(obj)
 
 PyAPI_DATA(PyTypeObject) PyLoadparmContext;