GNOME Bugzilla – Bug 772209
[CCode(simple_generics = true)] generates invalid C code
Last modified: 2018-05-22 15:39:26 UTC
Hey, when declaring a function e. g. like this: [CCode(simple_generics = true)] extern GLib.HashTable<K, V> g_hash_table_ref<K, V>(GLib.HashTable<K, V> ht); The generated C prototype will look like this: GHashTable* g_hash_table_ref (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GHashTable* ht); But because of the simple_generics attribute, at the call site only a single argument (i. e. the hash table) will be passed. The resulting C code can not be compiled due to this.
Created attachment 336553 [details] [review] simple attempt at fixing the bug
Created attachment 336994 [details] [review] WIP Hanlde simple_generics in more cases. This might not be possible though.
Hey Rico, could you be a bit more specific? What is it that might not be possible?
Hey Rico, what else do you think needs to be done to fix this bug?
-- 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/vala/issues/557.