Skip to content

Fix case when typedef references struct that is not yet declared #88

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

Closed
kornilova203 opened this issue Jun 30, 2018 · 2 comments
Closed
Assignees
Labels
bindgen Binding generator bug Something isn't working
Milestone

Comments

@kornilova203
Copy link
Member

Generating bindings for /usr/include/uv.h gives lots of errors and does not output Scala code:

Failed to get declaration for struct __fsid_t
Failed to get declaration for struct _IO_FILE
Failed to get declaration for struct __va_list_tag
...

The problem is that typedef for struct can be located above struct declaration:

typedef struct myStruct mystruct;

struct myStruct {
    int a;
};

So when TreeVisitor visits typedef it is unable to translate struct myStruct because type is not yet in TypeTranslator::aliasesMap

@kornilova203 kornilova203 added the bug Something isn't working label Jun 30, 2018
@kornilova203 kornilova203 added this to the 0.2 milestone Jun 30, 2018
@jonas
Copy link
Member

jonas commented Jul 1, 2018

This is similar to #78 or at least it looks like both would require the same sort of step-wise initialization behavior.

@jonas jonas added the bindgen Binding generator label Jul 1, 2018
@kornilova203
Copy link
Member Author

Yes, it is similar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bindgen Binding generator bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants