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

Generate forward declarations for structs with cyclical pointer references #43

Open
eqrion opened this issue Aug 17, 2017 · 1 comment
Open
Labels

Comments

@eqrion
Copy link
Owner

@eqrion eqrion commented Aug 17, 2017

Example

struct Foo {
    data: *const Bar,
}
struct Bar {
    data: *const Foo,
}

Possible output

struct Bar;
struct Foo {
    const Bar* data;
}
struct Bar {
    const Foo* data;
}

This would require the dependency ordering algorithm to understand when a reference needs a declaration and when it needs a definition. If in the previous example, the data members were not pointers then it wouldn't work.

@Hywan
Copy link

@Hywan Hywan commented Jun 4, 2018

Hello :-),

Thanks for cbindgen!

I'm facing this issue right now. Any idea how to solve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.