You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From what I can tell from the docs, there is no way to add prefixes to function parameters. I think it would be useful to be able to do so. My motivating example is Windows SAL
To clarify to C++ consumers what the Rust code expects. Out pointers, strings vs pointers, optional parameters, and others. So that I can transform a Rust decl like this:
#[must_use]pubunsafeextern"C"fninit(obj_out:*mut*mutSomeThing,file:Option<NonNull<c_char>>,handle:RawHandle,) -> Status
structSomeThing {
// Null-terminated string
_Field_z_ constchar *name;
// Not null-terminated, the length is in the preceding fielduintptr_t len;
_Field_size_(len) constchar *serial;
};
The text was updated successfully, but these errors were encountered:
From what I can tell from the docs, there is no way to add prefixes to function parameters. I think it would be useful to be able to do so. My motivating example is Windows SAL
https://learn.microsoft.com/en-us/cpp/code-quality/understanding-sal?view=msvc-170
To clarify to C++ consumers what the Rust code expects. Out pointers, strings vs pointers, optional parameters, and others. So that I can transform a Rust decl like this:
into this C++ decl
What the annotation would look like, I'm not sure. Maybe something like
/// cbindgen:param-prefix = [_Outptr_, _In_opt_z_, _In_]
and to a lesser extent for struct decls, though it's not as important to me.
->
The text was updated successfully, but these errors were encountered: