Macro dlib::ffi_dispatch[][src]

macro_rules! ffi_dispatch {
    (feature=$feature: expr, $handle: ident, $func: ident, $($arg: expr),*) => { ... };
    ($handle: ident, $func: ident, $($arg: expr),*) => { ... };
}

Macro for generically invoking a FFI function

The expected arguments are, in order:

The macro invocation evaluates to the return value of the FFI function.

Example

Assuming an FFI function of signature fn(u32, u32) -> u32:

let sum = unsafe { ffi_dispatch!(feature="dlopen", LIBRARY_HANDLE, sum, 2, 2) };