GNOME Bugzilla – Bug 616815
GStrv not usable as struct field
Last modified: 2015-02-07 16:57:10 UTC
struct _TpAvatarRequirements { GStrv supported_mime_types; guint minimum_width; guint minimum_height; ... }; When running g-ir-compiler: ** WARNING **: field TelepathyGLib.AvatarRequirements.supported_mime_types has void type aborting... GIR: <record name="AvatarRequirements" c:type="TpAvatarRequirements" doc="..." version="0.11.UNRELEASED" glib:type-name="TpAvatarRequirements" glib:get-type="tp_avatar_requirements_get_type"> <field name="supported_mime_types" writable="1"> <type name="GObject.Strv" c:type="GStrv"/> Changing to using 'char **' works around this.
Created attachment 162451 [details] [review] Fix GStrv as struct fields. * gir/gimarshallingtests.[hc]: Add a test for struct fields of type GStrv * girepository/giroffsets.c: Correctly compute the size of structs with array fields * girepository/girparser.c: Set is_pointer to FALSE for arrays with fixed size inside structs. * giscanner/glibtransformer.py: Special case GStrv fields as arrays of utf8.
Tested that patch with tp-glib API, and it indeed fix the compilation issue when I have GStrv in a struct. I had to also apply the patch from bug #620247 to pygi to make it work in python code, otherwise it enters infinite loop.
*** This bug has been marked as a duplicate of bug 620170 ***
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]