PyVarObject_HEAD_INIT() compatibility macro for Python < 2.6
authorPanu Matilainen <pmatilai@redhat.com>
Mon, 19 Oct 2009 08:06:07 +0000 (11:06 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Mon, 19 Oct 2009 08:06:07 +0000 (11:06 +0300)
python/rpmsystem-py.h

index afd88fb..35c0f4d 100644 (file)
@@ -15,8 +15,15 @@ typedef ssize_t Py_ssize_t;
 typedef Py_ssize_t (*lenfunc)(PyObject *);
 #endif  
 
+/* Compatibility macros for Python < 2.6 */
+#ifndef PyVarObject_HEAD_INIT
+#define PyVarObject_HEAD_INIT(type, size) \
+       PyObject_HEAD_INIT(type) size,
+#endif 
+
 #ifndef Py_TYPE
 #define Py_TYPE(o) ((o)->ob_type)
 #endif
 
+
 #endif /* H_SYSTEM_PYTHON */