GNOME Bugzilla – Bug 590913
gir-repository fails to build due gtk_widget_get_allocation
Last modified: 2015-02-07 16:48:30 UTC
This is the error reported in my jhbuild sandbox: libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I/opt/gnome2/include/gtk-2.0 -I/opt/gnome2/lib64/gtk-2.0/include -I/opt/gnome2/include/atk-1.0 -I/opt/gnome2/include/cairo -I/opt/gnome2/include/pango-1.0 -I/opt/gnome2/include/glib-2.0 -I/opt/gnome2/lib64/glib-2.0/include -I/opt/gnome2/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -g -O2 -MT libgirepo_Gtk_custom_la-Gtk-custom.lo -MD -MP -MF .deps/libgirepo_Gtk_custom_la-Gtk-custom.Tpo -c ./Gtk-custom.c -fPIC -DPIC -o .libs/libgirepo_Gtk_custom_la-Gtk-custom.o In file included from ./Gtk-custom.c:10: ./Gtk-custom.h:18: error: conflicting types for ‘gtk_widget_get_allocation’ /opt/gnome2/include/gtk-2.0/gtk/gtkwidget.h:602: error: previous declaration of ‘gtk_widget_get_allocation’ was here ./Gtk-custom.c:60: error: conflicting types for ‘gtk_widget_get_allocation’ /opt/gnome2/include/gtk-2.0/gtk/gtkwidget.h:602: error: previous declaration of ‘gtk_widget_get_allocation’ was here
gtk_widget_get_allocation() was added here: http://bugzilla.gnome.org/show_bug.cgi?id=585211
Created attachment 140667 [details] [review] Remove gtk_widget_get_allocation() So the stupid approach is to just remove stuff from Gtk-custom.*. Not sure it's enough, but it should build, at least ;-)
The gtk-custom removal is right. Providing stuff in the GTK+ namespace was always questionable. I think you want to add however: /** * gtk_widget_get_allocation: * @widget: the widget * @allocation: (out): location to store the allocation */ To get the function properly annotated. (There are some problems with gobject-introspection not having a proper idea of out-structs-by-value, but I don't think the above will make thigns worse.)
Created attachment 140809 [details] [review] Fix for addition of gtk_widget_get_allocation() to GTK+ gtk_widget_get_allocation() was recently added to GTK+, so having a custom function barging into the GTK+ namespace just doesn't work any more. Remove the custom gtk_widget_get_allocation(), add annotations for the new gtk_widget_get_annotation(). Based on patch from Vincent Untz
Pushed your patch with the addition of the annotation. Even with the annotation it will likely break current users of the gtk_widget_get_allocation() custom function, because of the gobject-introspection/gjs problems mentioned above, but that's not gir-repository's fault. We really need to remove all the -custom functions - they were a bad idea from the start and only can lead to further breakage like this.
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]