Why does std::ffi, specifically CStr and CString not (at least fully in the case of std::ffi) work?
I do not know whether or not this is purposeful due to some limitations or something of the sort, but a lot of the types from std::ffi don't seem to be supported. For example, trying to use CStr and CString in external functions, or the other types that aren't supported gives this message:
WARN: Can't find <type>. This usually means that this type was incompatible or not found.
Why doesn't this work, and if it does work, how do I get it working?
So... CString is not supposed to work, because it's not ABI-compatible, but we should add it to the opaque type list here: https://github.com/eqrion/cbindgen/blob/ccd1f0e9ec2369735b9481c85057b9c65b6b0908/src/bindgen/parser.rs#L430-L460 so that you can pass them by reference or so probably. Same for CStr, which is not ffi-safe either, actually (so you shouldn't use them in function signatures, see the docs).
Thanks for telling me, I'll pass an array of chars instead.
Is this issue supposed to be closed?