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 generated functions are ignored in header generation #976

Open
dmulder opened this issue Jun 12, 2024 · 2 comments
Open

Macro generated functions are ignored in header generation #976

dmulder opened this issue Jun 12, 2024 · 2 comments

Comments

@dmulder
Copy link

dmulder commented Jun 12, 2024

I have several functions which are relevant to multiple objects, so I created some macros to reduce code duplication. When I generate the header file, the generated functions are excluded from the header file. I can see the symbols are present in the generated shared object library.

I read somewhere that I needed to set [parse.expand] crates in my cbindgen.toml in order to pre-process the sources to generate the header correctly. I tried this, and it made no difference at all.

I'm using cargo cbuild to wrap cbindgen, but the same happens manually calling cbindgen.

You can see the sources here: https://gitlab.com/davidmmulder/libhimmelblau/-/tree/dmulder/serialize_deserialize?ref_type=heads

@jschwe
Copy link
Contributor

jschwe commented Jun 22, 2024

https://gitlab.com/davidmmulder/libhimmelblau/-/tree/dmulder/serialize_deserialize?ref_type=heads

That link gives a 404 for me. Is the project visible to the public?

@dmulder
Copy link
Author

dmulder commented Jun 27, 2024

https://gitlab.com/davidmmulder/libhimmelblau/-/tree/dmulder/serialize_deserialize?ref_type=heads

That link gives a 404 for me. Is the project visible to the public?

Sorry, I merged the branch and deleted it afterward. Sources are here: https://gitlab.com/samba-team/libhimmelblau/

Notice that I'm having to manually include the function prototypes for macro generated functions in my cbindgen.toml, because I couldn't find a way to pre-process and expand the macros.

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