Skip to content

Manually avoid declaring opaque structs #500

@kvark

Description

@kvark

My code uses the following types on the FFI:

struct Foo(NonZeroU64);
struct Bar {
  foo: Option<Foo>,
}

What I want here really is foo: u64.

What cbindgen ends up producing is:

typedef struct Option_Foo Option_Foo;

It looks like this opaque type leaves me no way to redefine the binding in the header, or work around otherwise. Is there anything we could to do make this work?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions