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

Comments

Projects
None yet
2 participants
@eqrion
Owner

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

This comment has been minimized.

Show comment
Hide comment
@Hywan

Hywan Jun 4, 2018

Hello :-),

Thanks for cbindgen!

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

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