s4-pyrpc: fixed build on python 2.4
authorAndrew Tridgell <tridge@samba.org>
Mon, 20 Sep 2010 19:16:09 +0000 (12:16 -0700)
committerAndrew Tridgell <tridge@samba.org>
Mon, 20 Sep 2010 22:27:45 +0000 (15:27 -0700)
Pair-Programmed-With: Jelmer Vernooij <jelmer@samba.org>

source4/librpc/rpc/pyrpc.h
source4/librpc/rpc/pyrpc_util.c

index c3bc83877ccb4d130486dd72de46bc534f65b31e..52f4f4d3d379b9b9b1000656970b89d6b267cc5e 100644 (file)
 
 #include "libcli/util/pyerrors.h"
 
+#ifndef Py_TYPE /* Py_TYPE is only available on Python > 2.6 */
+#define Py_TYPE(ob)             (((PyObject*)(ob))->ob_type)
+#endif
+
 #define PY_CHECK_TYPE(type, var, fail) \
        if (!PyObject_TypeCheck(var, type)) {\
                PyErr_Format(PyExc_TypeError, __location__ ": Expected type '%s' for '%s' of type '%s'", (type)->tp_name, #var, Py_TYPE(var)->tp_name); \
index ba42c08154a4c0839f00b802327e3d1f03008ba5..33bce387afeeeff65813eeed666fc7bc82105691 100644 (file)
 #include "lib/messaging/messaging.h"
 #include "lib/messaging/irpc.h"
 
-#ifndef Py_TYPE /* Py_TYPE is only available on Python > 2.6 */
-#define Py_TYPE(ob)             (((PyObject*)(ob))->ob_type)
-#endif
-
 bool py_check_dcerpc_type(PyObject *obj, const char *module, const char *typename)
 {
        PyObject *mod;