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
Exported statics aren't declared in the generated header #47
Comments
Yeah cbindgen should definitely be able to handle this. Finding static declarations won't be too challenging, the harder part is knowing which ones to output. Right now we only output declarations that are using by the FFI, but that won't work here. I suppose we could just output all static items with |
That's the behaviour I'd expect, I don't know of any reason for not mangling names other than for FFI export. |
@eqrion what about |
I was about to open an issue for this, but looks like it's already been mentioned. I reckon |
At least numbers support will be fine for now. |
Fixed in 0.1.27. Please reopen if you're still having an issue with this. |
Thanks 👍 |
I've got some Rust code looking like this:
These are used as return codes for some of my API functions, but when cbindgen runs it doesn't include their declarations in the header. I'd expect it to include them like this:
If I add the above block to cbindgen's
trailer
config string, I can then use the constants in the C code that calls my library, but isn't this the sort of thing that cbindgen should be doing automatically?The text was updated successfully, but these errors were encountered: