rust-bindgen icon indicating copy to clipboard operation
rust-bindgen copied to clipboard

Missing constant defines when definition is a cast

Open hcldan opened this issue 5 months ago • 1 comments

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 avatar Jan 23 '24 19:01 hcldan

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)

hcldan avatar Jan 24 '24 15:01 hcldan