-
Notifications
You must be signed in to change notification settings - Fork 115
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
Incorrect PROC typedef #438
Comments
The fix makes sense to me. |
Yeah, as you can see from the comment I had no idea what I was doing when I was translating those type defs! What does I'm also guessing we would have to do a major release seeing as its an API change. |
You can use what winapi does as an example of how it should be done. Raw pointer to an opaque type (can be replaced with |
Wondering if we should just depend on winapi somehow for these types rather than having to maintain our own, but that's a separate issue 🤔 |
The canonical equivalent for C function pointers into Rust is |
Raw pointers to uninhabited types are legal and well defined (because they can be created in safe code). You just can never ever deref it. All you have to do is transmute the raw pointer to |
* friendly bump * Any ETA on this? |
Is this going to be fixed any time soon? Currently you cannot run release builds of programs using gl-rs on windows using current nightly rustc. * yet another friendly bump * |
Sorry for delays, |
* Update gl_generate to 0.7 This is required for projects using gfx_gl to be run when compiled with release flag using nightly version of rustc starting with 19. november 2k17. brendanzab/gl-rs#438 * Update Cargo.toml
This closes glium#1648, an issue originally caused by brendanzab/gl-rs#438. This includes the winit 0.9 update. Changelog details [here](https://github.com/tomaka/winit/blob/master/CHANGELOG.md#version-090-2017-12-01).
I've just encountered the very same typing bug resulting in segmentation fault due to
Fixing the type fixes the crash for me. |
So, it's been two weeks. Can we fix it for GLX too? Should I open a new issue? |
The definition of
PROC
causes issues on the latest nightly. The functions aren't allow to be zero, which rust makes use by annotating them with non-null. Unfortunately, the returned functions bywglGetProcAddress
can be zero (e.g GL1.1 functions). Glutin currently checks if the functions are zero else it queries the addresses viakernel32::GetProcAddress
. The rust compiler optimizes this call away as it assumes we don't have null functions.The proposed solution is to replace
extern "system" fn()
with*const ()
, which also fixes the issue for me locally.The text was updated successfully, but these errors were encountered: