Exclude broken bindings for GLib functions #365
No reviewers
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
java
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
java-gi/java-gi!365
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "glib-metadata"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
GLib offers a lot of C convenience functionality that is included in the GIR file, but is broken or unusable from Java. This PR adds metadata to exclude all broken/unusable functions that I'm aware of:
g_atomic_int(raw pointers)atomic_rc_box_release_fullandrc_box_release_full(DestroyNotify parameter is unusable)atomic_ref_countandref_count(unusable, broken)base64_decode_step(useless: re-allocates the buffers on every call)base64_encode_stepandbase64_encode_close(the out-buffer is leaked and is not read)clear_listandclear_slist(raw MemorySegment element-type, and will cause a double-free)GDataandDataset) (very hard to use from bindings)idle_remove_by_data(unusable)intern_static_string(broken)quark_from_static_string(broken)refcounttype (broken)ref_stringfunctions (broken)return_if_fail_warningandwarn_message(macro related)slicefunctions (deprecated in GLib)snprintf,strup,strdup(broken)spawn_check_exit_status(deprecated in GLib)unicode_canonical_decomposition(deprecated in GLib, and broken)utf8functions (there are probably better ways to do this in Java directly)utime(broken)win32_get_system_data_dirs_for_module(broken)Excluding these functions is technically an API change, but the Java bindings for almost all of these were broken or unusable in various ways.
There are still many GLib functions in the Java bindings that should not be used, because there are better ways to do the same thing in Java itself, but I don't want to add more manual overrides than necessary, so I tried to only remove things for which the bindings do not work or should really not be used.