1 diff -ur sip-4.4.5/siplib/objmap.c sip-4.4.5.phh/siplib/objmap.c
2 --- sip-4.4.5/siplib/objmap.c 2006-06-10 13:36:40.000000000 +0200
3 +++ sip-4.4.5/siplib/objmap.c 2006-07-14 17:21:18.053987000 +0200
5 * of it, or vice versa, then we assume it is the same C++
8 - if (PyObject_TypeCheck(w,&type -> super.type) ||
9 - PyType_IsSubtype(&type -> super.type,w -> ob_type))
10 + if (PyObject_TypeCheck(w,&type -> super.ht_type) ||
11 + PyType_IsSubtype(&type -> super.ht_type,w -> ob_type))
15 diff -ur sip-4.4.5/siplib/sip.h sip-4.4.5.phh/siplib/sip.h
16 --- sip-4.4.5/siplib/sip.h 2006-06-10 13:36:41.000000000 +0200
17 +++ sip-4.4.5/siplib/sip.h 2006-07-15 11:12:32.928487750 +0200
19 #define sipTypeIsAbstract(wt) ((wt)->type->td_flags & SIP_TYPE_ABSTRACT)
20 #define sipTypeHasSCC(wt) ((wt)->type->td_flags & SIP_TYPE_SCC)
22 +//Hack to build against python 2.5
23 +#if PY_MAJOR_VERSION==2 && PY_MINOR_VERSION <= 4
31 diff -ur sip-4.4.5/siplib/siplib.c sip-4.4.5.phh/siplib/siplib.c
32 --- sip-4.4.5/siplib/siplib.c 2006-06-10 13:36:40.000000000 +0200
33 +++ sip-4.4.5/siplib/siplib.c 2006-07-14 17:20:48.400133750 +0200
35 if (PyType_Ready(&sipWrapperType_Type) < 0)
36 Py_FatalError("sip: Failed to initialise sip.wrappertype type");
38 - if (PyType_Ready(&sipWrapper_Type.super.type) < 0)
39 + if (PyType_Ready(&sipWrapper_Type.super.ht_type) < 0)
40 Py_FatalError("sip: Failed to initialise sip.wrapper type");
42 if (PyType_Ready(&sipVoidPtr_Type) < 0)
47 - if ((wt = *mw++) != NULL && addInstances(wt->super.type.tp_dict, &wt->type->td_instances) < 0)
48 + if ((wt = *mw++) != NULL && addInstances(wt->super.ht_type.tp_dict, &wt->type->td_instances) < 0)
53 if (type->td_scope.sc_flag)
56 - dict = getClassType(&type->td_scope, client)->super.type.tp_dict;
57 + dict = getClassType(&type->td_scope, client)->super.ht_type.tp_dict;
59 /* Add the type to the "parent" dictionary. */
60 if (PyDict_SetItem(dict,name,(PyObject *)wt) < 0)
65 - dict = client->em_types[ed->e_scope]->super.type.tp_dict;
66 + dict = client->em_types[ed->e_scope]->super.ht_type.tp_dict;
68 /* Create the base type tuple if it hasn't already been done. */
69 if (bases == NULL && (bases = Py_BuildValue("(O)",&PyInt_Type)) == NULL)
72 self = PyTuple_GET_ITEM(args,argnr);
74 - if (!PyObject_TypeCheck(self,&type -> super.type))
75 + if (!PyObject_TypeCheck(self,&type -> super.ht_type))
78 *selfp = (sipWrapper *)self;
81 /* If this is a wrapped type then get the type dictionary. */
82 if (sipWrapperType_Check(dict))
83 - dict = ((sipWrapperType *)dict)->super.type.tp_dict;
84 + dict = ((sipWrapperType *)dict)->super.ht_type.tp_dict;
86 return addSingleEnumInstance(dict, name, value, type);
90 /* If this is a wrapped type then get the type dictionary. */
91 if (sipWrapperType_Check(dict))
92 - dict = ((sipWrapperType *)dict) -> super.type.tp_dict;
93 + dict = ((sipWrapperType *)dict) -> super.ht_type.tp_dict;
95 return addSingleClassInstance(dict,name,cppPtr,wt,0);
99 /* If this is a wrapped type then get the type dictionary. */
100 if (sipWrapperType_Check(dict))
101 - dict = ((sipWrapperType *)dict)->super.type.tp_dict;
102 + dict = ((sipWrapperType *)dict)->super.ht_type.tp_dict;
104 if ((w = mt->mt_cfrom(cppPtr, NULL)) == NULL)
106 @@ -4534,7 +4534,7 @@
107 if (pyObj == Py_None)
108 ok = ((flags & SIP_NOT_NONE) == 0);
109 else if (cto == NULL || (flags & SIP_NO_CONVERTORS) != 0)
110 - ok = PyObject_TypeCheck(pyObj, &type->super.type);
111 + ok = PyObject_TypeCheck(pyObj, &type->super.ht_type);
113 ok = cto(pyObj, NULL, NULL, NULL);
115 @@ -4954,7 +4954,7 @@
116 * convertor might be able to convert the target type
117 * to something more specific.
119 - if (PyType_IsSubtype(&type -> super.type,&scc -> scc_basetype -> super.type))
120 + if (PyType_IsSubtype(&type -> super.ht_type,&scc -> scc_basetype -> super.ht_type))
122 sipWrapperType *subtype;
124 @@ -5508,7 +5508,7 @@
125 * We check by comparing the actual type name with the name used to
126 * create the original wrapped type.
128 - if ((name = PyString_AsString(wt->super.name)) == NULL)
129 + if ((name = PyString_AsString(wt->super.ht_name)) == NULL)
132 return (strcmp(name, getBaseName(wt->type->td_name)) == 0);
133 @@ -5564,7 +5564,7 @@
135 if (self -> type == NULL)
137 - PyObject *sc = (PyObject *)self->super.type.tp_base;
138 + PyObject *sc = (PyObject *)self->super.ht_type.tp_base;
141 * Make sure that the type is derived from sip.wrapper. It
142 @@ -5573,7 +5573,7 @@
144 if (sc == NULL || !sipWrapperType_Check(sc))
146 - PyErr_Format(PyExc_TypeError, "type %s must be derived from sip.wrapper", self->super.type.tp_name);
147 + PyErr_Format(PyExc_TypeError, "type %s must be derived from sip.wrapper", self->super.ht_type.tp_name);
151 @@ -5608,7 +5608,7 @@
155 - dict = wt -> super.type.tp_dict;
156 + dict = wt -> super.ht_type.tp_dict;
158 /* The base type doesn't have any type information. */
159 if ((td = wt->type) == NULL || !isExactWrappedType(wt))
160 @@ -5826,7 +5826,7 @@
163 /* See if it is an abstract type. */
164 - if (sipTypeIsAbstract(wt) && strcmp(strchr(wt->type->td_name, '.') + 1, wt->super.type.tp_name) == 0)
165 + if (sipTypeIsAbstract(wt) && strcmp(strchr(wt->type->td_name, '.') + 1, wt->super.ht_type.tp_name) == 0)
167 PyErr_Format(PyExc_TypeError, "%s represents a C++ abstract class and cannot be instantiated", wt->type->td_name);
169 @@ -5835,7 +5835,7 @@
172 /* Call the standard super-type new. */
173 - return PyBaseObject_Type.tp_new(&wt -> super.type,args,kwds);
174 + return PyBaseObject_Type.tp_new(&wt -> super.ht_type,args,kwds);
178 @@ -6402,7 +6402,7 @@
180 /* Add the slots for this type. */
181 if (td -> td_pyslots != NULL)
182 - initSlots(&wt->super.type, &wt->super.as_number, &wt->super.as_sequence, &wt->super.as_mapping, td->td_pyslots, FALSE);
183 + initSlots(&wt->super.ht_type, &wt->super.as_number, &wt->super.as_sequence, &wt->super.as_mapping, td->td_pyslots, FALSE);
185 /* Recurse through any super-types. */
186 if ((sup = td -> td_supers) != NULL)