You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have this issue where I am adding non abi-breaking methods to some of the structs emitted by cbindgen. However, some of them require the full definition of other structures to be emitted before.
For example, I have something equivalent to the following in my cbindgen.toml
(I am defining the body of bar_method using the trailing configuration option).
In this case, a simple forward declaration for Foo will not work, as I specifically want to use the generated Tag field. FWIW, the rust code for Foo would look something like this:
pubenumFoo{MyFoo1(u8),MyFoo2(u8),}
I saw issue #43 which is similar in a way. I think that having a field in the [export] table (similar to [export.body]) that allows manually specifying a dependency for an item would be beneficial. This feature would work as a workaround for that issue, in that we could use this configuration option to get around deficiencies in the dependency logic.
Right now, what I am doing is actually adding Foo to [export.exclude], and then putting what cbindgen would generate for it in the after_includes configuration field. This is fairly brittle, however, as I have to remember to change it should the definition of Foo ever change.
The text was updated successfully, but these errors were encountered:
I have this issue where I am adding non abi-breaking methods to some of the structs emitted by cbindgen. However, some of them require the full definition of other structures to be emitted before.
For example, I have something equivalent to the following in my
cbindgen.toml
(I am defining the body of bar_method using the
trailing
configuration option).In this case, a simple forward declaration for
Foo
will not work, as I specifically want to use the generatedTag
field. FWIW, the rust code for Foo would look something like this:I saw issue #43 which is similar in a way. I think that having a field in the
[export]
table (similar to[export.body]
) that allows manually specifying a dependency for an item would be beneficial. This feature would work as a workaround for that issue, in that we could use this configuration option to get around deficiencies in the dependency logic.Right now, what I am doing is actually adding
Foo
to[export.exclude]
, and then putting what cbindgen would generate for it in theafter_includes
configuration field. This is fairly brittle, however, as I have to remember to change it should the definition ofFoo
ever change.The text was updated successfully, but these errors were encountered: