Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for C bitfields #465

Open
sdroege opened this issue Sep 18, 2017 · 1 comment
Open

Add support for C bitfields #465

sdroege opened this issue Sep 18, 2017 · 1 comment

Comments

@sdroege
Copy link
Member

sdroege commented Sep 18, 2017

Blocked by rust-lang/rfcs#314 but we need that for the remaining types missing in glib-sys, etc.

@GuillaumeGomez
Copy link
Member

Is it done?

yvt added a commit to yvt/Stella2 that referenced this issue May 21, 2020
gtk-rs/gir (automatic binding generator for gtk-rs) currently don't
support[1] structs with bitfields and translates them to
incorrectly-sized `struct`s. As a result, `pango_sys::PangoLogAttr` was
twice as long as it was supposed to be, and the output of
`get_log_attrs_readonly` referred out of bounds. This is why we saw a
text cursor in an `Entry` skipping characters when the user pressed
arrow keys.

This commit addresses this problem by interpreting `PangoLogAttr*` as
`LogAttrFlags*` (which we already have) and carefully laying out
`LogAttrFlags` according to `PangoLogAttr`.

[1]: gtk-rs/gir#465
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants