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

issue with simple #define #510

Open
jw3126 opened this issue Sep 25, 2024 · 2 comments
Open

issue with simple #define #510

jw3126 opened this issue Sep 25, 2024 · 2 comments
Labels

Comments

@jw3126
Copy link

jw3126 commented Sep 25, 2024

typedef int INT;
#define FIVE      ((INT) 4+1)

produces the following nonsense definition:

const INT = Cint

const FIVE = (INT(4))(1)
@JamesWrigley
Copy link
Member

I don't know the proper fix for this off the top of my head, but FWIW if you don't need macros to be wrapped you could set macro_mode = "disable" in the generator config:

macro_mode = "basic"

Alternatively I think you could add FIVE to the output_ignorelist to stop it from being printed:

output_ignorelist = [

@jw3126
Copy link
Author

jw3126 commented Sep 25, 2024

Thanks! This is just an MWE in my real use case I have tons of macros that follow this pattern: Add an offset and cast it.

@Gnimuc Gnimuc added the macro label Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants