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 std::ffi::* instead of the std::os::raw::* types #2924

Open
nyurik opened this issue Sep 6, 2024 · 1 comment
Open

Generate std::ffi::* instead of the std::os::raw::* types #2924

nyurik opened this issue Sep 6, 2024 · 1 comment

Comments

@nyurik
Copy link

nyurik commented Sep 6, 2024

std::os::raw recommends to use core::ffi instead, but for std crates using core directly seem to trigger some warnings. The std::ffi::* offers the same types like c_char and c_int as core::ffi::*, plus it offers the newer types like CStr in there. Would it make sense to consistently use just the std::ffi::* for all C types in the generated code?

P.S. I am aware that this can be done with .ctypes_prefix("::std::ffi") param - but the question is if this should be done by default?

@pvdrz
Copy link
Contributor

pvdrz commented Sep 6, 2024

I think core::ffi is used if the use_core option is enabled and the rust target is high enough. Isn't that the case?

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

No branches or pull requests

2 participants