ndk,ndk-glue: Do not pass Looper ident as userdata pointer#112
Conversation
c9074f3 to
0a184e6
Compare
|
@msiglreith I'm thinking about merging this and releasing a minor version bump this weekend, followed by an MR in winit to use the new version and constants. Any other breaking changes we might want to get in? (Manifest changes - which I also intend to finally look at - are only build-related fortunately) |
0a184e6 to
2856b3a
Compare
|
Sounds good to me. I think there is nothing else in the pipeline right now. |
2856b3a to
1711e85
Compare
The value of `0` or `1` is not a valid pointer to a userdata structure. Not that it has to be, but with the nasty consequence that winit Android code was accidentally reinterpreting this pointer as integer to extract the identifier from, instead of using the appropriate `ident` field directly. After that is addressed in winit we can set the pointer back to 0 cleanly (and prepare for a potential pointer to some user data that may be passed in the future). Also add some constants to document these "special" identifiers.
1711e85 to
f9bb13e
Compare
|
@msiglreith Shall we bump the version at the same time, or in one PR? Also, do we want to keep |
|
@MarijnS95 Doing the version bump in this PR is fine.
I would prefer to keep it at the current version in this case. |
|
@msiglreith neat, so the Let's merge this then :) |
Following the changes in [1] this bumps ndk and ndk-glue to 0.3 and uses the new constants. The minor version has been bumped to prevent applications from running an older winit (without rust-windowing#1826) with a newer ndk/ndk-glue that does not pass this `ident` through the `data` pointer anymore. [1]: rust-mobile/ndk#112
…1847) Following the changes in [1] this bumps ndk and ndk-glue to 0.3 and uses the new constants. The minor version has been bumped to prevent applications from running an older winit (without #1826) with a newer ndk/ndk-glue that does not pass this `ident` through the `data` pointer anymore. [1]: rust-mobile/ndk#112
The value of
0or1is not a valid pointer to a userdata structure. Not that it has to be, but with the nasty consequence that winit Android code was accidentally reinterpreting this pointer as integer to extract the identifier from, instead of using the appropriateidentfield directly. After that is addressed in winit we can set the pointer back to 0 cleanly (and prepare for a potential pointer to some user data that may be passed in the future).Also add some constants to document these "special" identifiers.
Maintainers, this is a breaking change in
ndk-gluethat we want to bump our minor version for, to v0.3. Anyone upgrading now will always seenull()in thedatafield, wreckingwinitunless rust-windowing/winit#1826 is in, which will only land in 0.25.After releasing this we should do a small patch to
winitto use the new v0.3 crate together with the new constants for clarity.CC @nwessing: the extra bit of documentation in here might help your adventure into using the glue crate directly!