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

ParseCallbacks::field_visibility is not called for new type aliases #2966

Closed
nyurik opened this issue Oct 31, 2024 · 0 comments · Fixed by #2967
Closed

ParseCallbacks::field_visibility is not called for new type aliases #2966

nyurik opened this issue Oct 31, 2024 · 0 comments · Fixed by #2967

Comments

@nyurik
Copy link
Contributor

nyurik commented Oct 31, 2024

Given a header file

typedef const char *  VCL_STRING;

I would like to create a new alias type:

let bindings = bindgen::Builder::default()
    .header("src/wrapper.h")
    .parse_callbacks(Box::new(my_callbacks))
    .new_type_alias("VCL_STRING")
    .generate();

The above code generates this Rust code:

pub struct VCL_STRING(pub *const ::std::ffi::c_char);

My my_callbacks instance implements field_visibility callback, but it never gets called for the VCL_STRING type - thus I have no way for the field to be created as private or crate-public.

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

Successfully merging a pull request may close this issue.

1 participant