-
Notifications
You must be signed in to change notification settings - Fork 21
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
ssize_t is not a standard C type? #13
Comments
It is a type defined by POSIX. It is not in the C standard. The standard equivalent is ptrdiff_t. |
IMO we should just remove |
Note that cty is not a crate with "type aliases to standard C types"; it's a crate with "Type aliases to C types like c_int for use with bindgen" so I would not remove any type alias that bindgen uses as that's the main use case. Whether that's the case for |
Does bindgen generate a
So for supported targets, we do know whether the target has an One question is whether Another question is what shall we do if the user tries to use |
Bindgen always translates |
I think we should tell bindgen to use the "<ctypes_crate>" here (whether from Whether we should provide How does that sound ? |
Sounds fine, but note that bindgen supports both libc and |
We can make bindgen use libc::ssize_t when the user wants to use the libc / cty types, and I don't know if |
What's the point of that, if |
@emilio We know that all targets that Rust currently supports, if they do provide I do not know if this is the case for all future targets that Rust will support (maybe somebody else knows what POSIX says about If we ever support a target for which, This doesn't impact bindgen much, as in, if bindgen chooses to always use |
@japaric it appears that, at least for the time being, bindgen doesn't require |
From Stack Overflow. We support MSP430 at the moment but not MSP430X; IDK if the latter is supposed to be considered a different architecture when it comes to conditional compilation, but sounds like it would need
Sounds good to me. How should we specify the "the targets we know today"? A mix of cfg(arch) and cfg(os)? |
Pretty much, this is how libc does it now, so we can probably adapt that. Even though it might not be technically necessary, we probably want to be conservative in the supported targets and do a minor semver version bump. If that happens to break somebody's workflow, we can then manually add support for more targets in a backwards compatible way. EDIT: FWIW we managed to do this for libc by just being super careful and bumping the patch version a couple of months ago, so the minor version bump isn't strictly necessary. But currently |
cc @retep998
The text was updated successfully, but these errors were encountered: