s4:auth/pyauth.c - temporarily add compatibility code for Python 2.4
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Sun, 30 Jan 2011 16:55:41 +0000 (17:55 +0100)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Sun, 30 Jan 2011 18:07:57 +0000 (19:07 +0100)
This patch has been commited by request of Jelmer.

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Sun Jan 30 19:07:57 CET 2011 on sn-devel-104

source4/auth/pyauth.c

index 26de2c336d534fd272fddc770e9845bdc39f783b..2b310bfa1b89418420b908addb66f2eed72965ad 100644 (file)
 
 staticforward PyTypeObject PyAuthContext;
 
+/* 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;
+typedef intargfunc ssizeargfunc;
+#endif
+
+#ifndef Py_RETURN_NONE
+#define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None
+#endif
+
 static PyObject *py_auth_session_get_security_token(PyObject *self, void *closure)
 {
        struct auth_session_info *session = py_talloc_get_type(self, struct auth_session_info);