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

Missing constant defines when definition is a cast #2732

Open
hcldan opened this issue Jan 23, 2024 · 1 comment
Open

Missing constant defines when definition is a cast #2732

hcldan opened this issue Jan 23, 2024 · 1 comment

Comments

@hcldan
Copy link
Contributor

hcldan commented Jan 23, 2024

Input C/C++ Header

test.h

#define LOWPRIORITY ((unsigned short) 0xffff)

Bindgen Invocation

$ bindgen test.h

Actual Results

/* automatically generated by rust-bindgen 0.69.2 */

Expected Results

/* automatically generated by rust-bindgen 0.69.2 */

pub const LOWPRIORITY: u32 = 65535;

or even better:

/* automatically generated by rust-bindgen 0.69.2 */

pub const LOWPRIORITY: u16 = 65535;
@hcldan
Copy link
Contributor Author

hcldan commented Jan 24, 2024

When I do the same on windows, I don't see this problem.
So this appears to be a linux issue. (perhaps the c toolchains in use)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant