Skip to content
This repository was archived by the owner on Mar 4, 2024. It is now read-only.

Regenerate with latest gir/gir-files, remove use_boxed_functions #254

Merged
merged 2 commits into from
Jan 10, 2021

Conversation

MarijnS95
Copy link
Contributor

Regenerate after gtk-rs/gir-files#74, gtk-rs/gir#1032 and gtk-rs/gir#1033.


Update submodules and regenerate

gir-files only had whitespace cleanups and fresh imports of gir files, none of which affect code generated here.
gir however deprecated and removed use_boxed_functions, hence the replacement of g_boxed_copy/free with g_unix_mount_point_copy/free. See the previous commit for more details.


gio: Remove deprecated use_boxed_functions override

Gio.UnixMountPoint likely still uses use_boxed_functions because g_unix_mount_point_copy is only available on 2.54. However, the version statement on the next line already ensures this type is only available on that version or higher.

If anyone plans to support a lower version later on this can easily be coded up in gir to replace the panic on version mismatch with some cfg_if or #[cfg()] logic, just like what was done in gstreamer-rs.


CC @sdroege

`Gio.UnixMountPoint` likely still uses `use_boxed_functions` because
`g_unix_mount_point_copy` is only available on 2.54. However, the
`version` statement on the next line already ensures this type is only
available on that version or higher.

If anyone plans to support a lower version later on this can easily be
coded up in gir to replace the panic on version mismatch with some
`cfg_if` or `#[cfg()]` logic, just like what was done in [gstreamer-rs].

[gstreamer-rs]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/677/diffs?commit_id=3c610e12e5a72f3d25949d84e5a4756b7545e34a
`gir-files` only had whitespace cleanups and fresh imports of gir files,
none of which affect code generated here.
`gir` however deprecated and removed `use_boxed_functions`, hence the
replacement of `g_boxed_copy/free` with `g_unix_mount_point_copy/free`.
See the previous commit for more details.
@sdroege
Copy link
Member

sdroege commented Jan 10, 2021

Gio.UnixMountPoint likely still uses use_boxed_functions because g_unix_mount_point_copy is only available on 2.54. However, the version statement on the next line already ensures this type is only available on that version or higher.

Yeah, the reason is that the get_type() function was added in 2.54 as was the copy() function. The free() function existed since 2.16, but we need either get_type() or both copy() and free() for being able to bind a type.

@sdroege sdroege merged commit 9df8a0c into gtk-rs:master Jan 10, 2021
@MarijnS95
Copy link
Contributor Author

Yeah, we can't implement this without get_type so the paragraph about wishing to support it on a lower version (in PR description and commit) is moot.

Luckily you added version = "2.54" for that function in sys as the GLIB_AVAILABLE_IN_2_54 macro did not seem to make it to Gio-20.gir, the only mention is glib:get-type="g_unix_mount_point_get_type" which is why I did not notice 😬

@MarijnS95 MarijnS95 deleted the regenerate branch January 10, 2021 09:53
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants