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

Preprocessor define not generated if value is casted #798

Closed
drebbe-intrepid opened this issue Nov 12, 2022 · 1 comment
Closed

Preprocessor define not generated if value is casted #798

drebbe-intrepid opened this issue Nov 12, 2022 · 1 comment

Comments

@drebbe-intrepid
Copy link

drebbe-intrepid commented Nov 12, 2022

test.h

#define TEST_1 ((int)0x0000008)
#define TEST_2 (0x0000008)
#define TEST_3 (2+4)
#define TEST_4 2+4
#define TEST_5 6
#define TEST_6 2 + 4
#define TEST_7 6 // with a comment
bindgen test.h
/* automatically generated by rust-bindgen 0.60.1 */

pub const TEST_2: u32 = 8;
pub const TEST_3: u32 = 6;
pub const TEST_4: u32 = 6;
pub const TEST_5: u32 = 6;
pub const TEST_6: u32 = 6;
pub const TEST_7: u32 = 6;
bindgen --version
bindgen 0.60.1

Notice TEST_1 is missing without an error or warning present.

@emilio
Copy link
Collaborator

emilio commented Nov 14, 2022

Wrong repo but this seems rust-lang/rust-bindgen#316

@emilio emilio closed this as completed Nov 14, 2022
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

2 participants