s3-passdb: Fix python < 2.6 build errors in passdb python wrapper
authorAndrew Bartlett <abartlet@samba.org>
Sun, 14 Aug 2011 00:05:42 +0000 (10:05 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Sun, 14 Aug 2011 01:59:48 +0000 (03:59 +0200)
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Sun Aug 14 03:59:48 CEST 2011 on sn-devel-104

source3/passdb/py_passdb.c

index 17d4415f8aa25f47f06fb81082b253bd085d2959..30c3f8ccc93724a27ba754000c627b734d9aaa52 100644 (file)
 #define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None
 #endif
 
+#ifndef Py_TYPE /* Py_TYPE is only available on Python > 2.6 */
+#define Py_TYPE(ob)             (((PyObject*)(ob))->ob_type)
+#endif
+
 #ifndef PY_CHECK_TYPE
 #define PY_CHECK_TYPE(type, var, fail) \
        if (!PyObject_TypeCheck(var, type)) {\