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

Macro as function are ignored #2626

Closed
ValouBambou opened this issue Sep 6, 2023 · 1 comment
Closed

Macro as function are ignored #2626

ValouBambou opened this issue Sep 6, 2023 · 1 comment

Comments

@ValouBambou
Copy link

ValouBambou commented Sep 6, 2023

Input C/C++ Header

#define N 10
#define N2 (N << 2)
#define FN(x) (x + 1)
#define N3 (FN(N))

Bindgen Invocation

$ bindgen input.h

Actual Results

pub const N: u32 = 10;
pub const N2: u32 = 40;

Expected Results

I expected the FN macro to be expanded to 10 + 1 and then evaluated to 11.

pub const N: u32 = 10;
pub const N2: u32 = 40;
pub const N3:u32 = 11;
@pvdrz
Copy link
Contributor

pvdrz commented Sep 6, 2023

Duplicate of #753

@pvdrz pvdrz closed this as completed Sep 6, 2023
@pvdrz pvdrz marked this as a duplicate of #753 Sep 6, 2023
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