-
Notifications
You must be signed in to change notification settings - Fork 6
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
Structures with typedef #7
Comments
Hello, thanks for the compliment, litgen was indeed a lot of work! Concerning your issue I would think that you should use the code pre-processing utilities, and thus write a small Python function that transforms those structs into standard C++ structs. I did ask ChatGPT and he had a proposition which I did not test: https://chat.openai.com/share/e0cea5b6-7cb3-4e0e-9fd3-d982c915911c |
Hi again, thanks for the super fast answer. Your suggested workaround worked great for my case, at least for the simple example I was playing around with, I'll have to try it with the full codebase at some point and see if something else breaks. I did find something else that looks like a bug, which is related to this. See this simple type alias:
Now the produced pybind code is alright:
However, the stub isn't:
As Thanks! |
In this case, manually add this: VectorAlias: TypeAlias = Vector2D In the stub file (before the autogenerated part) |
Hi! Thanks for the tremendous work. I've been looking for something like this for a long time.
I'm just getting started and trying to get the hang of it. The first issue I encountered which I have not been able to solve is related to structures defined with typedef. I have a mixed C/C++ codebase and we have several structs typedef'd like this:
From what I have seen,
litgen
ignores these type definitions. Also triedusing
and got a similar results. Is there a configuration I need to enable to have type aliases included? I'm working with cppimport, but as far as I can tell the binding code is already missing for these types so I don't think that makes a difference.Here's a simple example:
This produces something that is missing the type definition
Any help is appreciated
Thanks!
The text was updated successfully, but these errors were encountered: