Function libffi::high::call::call
[−]
[src]
pub unsafe fn call<R: CType>(fun: CodePtr, args: &[Arg]) -> R
Performs a dynamic call to a C function.
To reduce boilerplate, see ffi_call!
.
Examples
extern "C" fn hypot(x: f32, y: f32) -> f32 { (x * x + y * y).sqrt() } use libffi::high::call::*; let result = unsafe { call::<f32>(CodePtr(hypot as *mut _), &[arg(&3f32), arg(&4f32)]) }; assert!((result - 5f32).abs() < 0.0001);