Build fails with Python master because Py_TYPE isn't assignable.
../../src/gobject-introspection-1.64.1/giscanner/giscannermodule.c:631:5: error: expression is not assignable
REGISTER_TYPE (d, "SourceScanner", PyGISourceScanner_Type);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/gobject-introspection-1.64.1/giscanner/giscannermodule.c:58:20: note: expanded from macro 'REGISTER_TYPE'
Py_TYPE(&type) = &PyType_Type; \
In cpython/Include/object.h:
static inline PyTypeObject* _Py_TYPE(const PyObject *ob) {
return ob->ob_type;
}
#define Py_TYPE(ob) _Py_TYPE(_PyObject_CAST_CONST(ob))
It can be fixed by replacing the Py_TYPE
macro:
#define REGISTER_TYPE(d, name, type) \
{ \
PyObject* ob = (PyObject*)(&type); \
ob->ob_type = &PyType_Type; \
type.tp_alloc = PyType_GenericAlloc; \
type.tp_new = PyType_GenericNew; \
type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; \
if (PyType_Ready (&type)) \
return MOD_ERROR_RETURN; \
PyDict_SetItemString (d, name, (PyObject *)&type); \
Py_INCREF (&type); \
}
Though that might be too hackish.