GNOME Bugzilla – Bug 687615
PARAM_READWRITE has wrong value in GObject-2.0.gir
Last modified: 2018-02-08 12:19:21 UTC
glib defines this as #define G_PARAM_READWRITE (G_PARAM_READABLE | G_PARAM_WRITABLE) in gobject/gparam.h, but this comes out wrong in the .gir: <constant name="PARAM_READWRITE" value="0" c:type="G_PARAM_READWRITE"> <type name="gint" c:type="gint"/> </constant> This should have a value of "3".
Same problem with <constant name="PARAM_STATIC_STRINGS" value="0" c:type="G_PARAM_STATIC_STRINGS"> which is defined as #define G_PARAM_STATIC_STRINGS (G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB) and thus should be 224.
Created attachment 273311 [details] [review] Test case
I ran into this as well and took a look at what GI does. You'll notice that G_PARAM_MASK, for example, does have the right value. What happens is that GI only picks up the value of the #define if it is a literal. One way around this is to compute the value if it can be done using already-introspected values from the symbol table. I'm not sure if this is actually possible. Another way (the 'head-in-the-sand' way) would be to change the definitions of G_PARAM_READWRITE and G_PARAM_STATIC_STRINGS to be integer literals. I attached a test case for this bug above.
See also https://bugzilla.gnome.org/show_bug.cgi?id=726037 which would fix the symptom but not the cause.
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gobject-introspection/issues/75.