-
Notifications
You must be signed in to change notification settings - Fork 742
use winapi crate instead of generating bindings to windows.h #1562
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
The way to do something like that is to blacklist the windows types and adding something like Bindgen shouldn't be crashing though (and it's somewhat suprising it does since I'm pretty sure on Firefox bindgen ends up including windows.h without issues). I don't have a windows machine, but would there be any chance for you to try to dump the contents make bindgen crash for you and upload them here? A reduced test-case would be extra-awesome, but just a reproducible crash / hang is awesome on its own. |
hi, bindgen doesn't crash but I get this error when compiling the generated bindings: error[E0588]: packed type cannot transitively contain a |
Yeah, with_rustfmt and such helps a lot to diagnose errors :) |
Why was this issue closed? IMO there should be a switch like |
The original author came to believe the underlying issue is a duplicate of another open issue. @bugproof, if you have a need, maybe you should open a new issue to describe what use you would have for |
I have the same problem. Was there ever a solution? Reproducible example is literally a header file that includes #include <windows.h>
#include "ViGEm/Client.h"
//
// Link against SetupAPI
//
#pragma comment(lib, "setupapi.lib") Ideally there would be some kind of |
followup: Looks like if you blacklist the following types build will succeed with all of windows.h:
|
Add Windows specific paths to build.rs. Add wintypedefs.h to the project. The header files are interpreted in the same way on all platforms, so files specific to the Linux package must be added to allow for building on Windows. The alternative would be to include the complete windows.h header in the bindings, which currently fails via bindgen and produces much bigger files. See also: rust-lang/rust-bindgen#1562
Hey, can somebody here answer the original question a bit better? How am I supposed to "blacklist the windows types"? I tried blocklisting windows.h and that doesn't work. I was suggested to use regex to filter out all the functions, but Microsoft uses hungarian notation so that doesn't work. |
Hi, I couln't find any way to do this in docs or the book, I am generating bindings to vulkan but when I add a definition to make it include windows support It includes windows.h, build takes a long time and it crashes with no output. I want to ignore the windows.h include somehow and use winapi crate instead. Is there a way to this?
The text was updated successfully, but these errors were encountered: