Attribute Macro interoptopus::ffi_function [−][src]
#[ffi_function]
This is supported on crate feature
derive
only.Expand description
Enable an extern "C"
function to appear in generated bindings.
This will derive FunctionInfo
for a helper struct
of the same name containing the function’s name, parameters and return value.
Parameters
The following parameters can be provided:
Parameter | Explanation |
---|---|
debug | Print generated helper code in console. |
Example
use interoptopus::ffi_function;
#[ffi_function]
#[no_mangle]
pub extern "C" fn my_function(x: u32) -> u32 {
x
}