-
Notifications
You must be signed in to change notification settings - Fork 328
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
Support 'pub const BAR: &str = "hello world";' #324
Comments
Rust It's possible to create constants on the C/C++ side that are similar to the Rust constants, but they wouldn't be able to passed over FFI unless they were wrapped somehow. What do you need this functionality for? |
my pet project is https://github.com/hyperledger/indy-sdk/tree/master/libindy and when I run cbindgen there it produces a ton of warnings. I would like to produce them with cbindgen. The constants are currently not exported but I think the should. Everything that comes through the API from C to Rust are C null terminated C 'strings'. The top API layer handles them. This is the use case. I am not there where I want this to be. |
Rust CStr is equivalent to C/C++ string literals. So I've just opened an issue asking for that: #927 |
currently cbindgen does not support const &st
pub const BAR: &'static str = "hello world";
I think that the bindings should be
#define BAR L"hello world"
for Cand
static const wchar_t* BAR = L"hello world";
for C++The text was updated successfully, but these errors were encountered: