2 ms·
#[no_mangle] turns off the name mangling so it emits a symbol in the style C would. But AFAIK it doesn't force the function to use C calling conventions. As dem
by eridius 10y ago
#[no_mangle] turns off the name mangling so it emits a symbol in the style C would. But AFAIK it doesn't force the function to use C calling conventions. As demonstrated in https://doc.rust-lang.org/book/ffi.html#calling-rust-code-from-c https://doc.rust-lang.org/book/ffi.html#calling-rust-code-fr... you probably still need the `extern` keyword on your function definition, e.g.
#[no_mangle]
pub extern unsafe fn lsm_view_from_json(bytes: *const u8, len: c_uint,
err_out: *mut CError) -> *mut View
{
...
}