We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
We'd like to expose a C API from Rust where all objects we define obtain a prefix, which can be very nicely done with
[export] prefix = "MyPackage_"
However, some function signatures use existing C objects, which should not obtain the prefix.
For example, say we have something like
use pyo3::ffi::PyObject; #[repr(C)] pub struct Thing { .. } #[no_mangle] #[cfg(feature = "cbinding")] pub unsafe extern "C" fn thing_to_py(thing: *mut Thing) -> *mut PyObject { .. }
Then the resulting header looks like
typedef struct { .. } MyPackage_Thing; // has prefix MyPackage_PyObject* thing_to_py(MyPackage_Thing thing); // PyObject should not have the prefix!
which is not quite what we want.
This can be worked around by doing the prefix manual, e.g. do not set the export.prefix but instead do
export.prefix
[export.rename] "Thing" = "MyPackage_Thing" # repeat for every object, except for PyObject...
It would be great if there was a way to exclude objects from prefix. E.g. something like
[export] prefix = "MyPackage_" prefix_ignores = ["PyObject"]
But maybe I'm just missing an already existing solution (which would be even better).
The text was updated successfully, but these errors were encountered:
Qk
ExitCode
Successfully merging a pull request may close this issue.
Problem
We'd like to expose a C API from Rust where all objects we define obtain a prefix, which can be very nicely done with
However, some function signatures use existing C objects, which should not obtain the prefix.
For example, say we have something like
Then the resulting header looks like
which is not quite what we want.
Workaround
This can be worked around by doing the prefix manual, e.g. do not set the
export.prefix
but instead doProposal
It would be great if there was a way to exclude objects from prefix. E.g. something like
But maybe I'm just missing an already existing solution (which would be even better).
The text was updated successfully, but these errors were encountered: