macro_rules! function {
(
$(
$vs:vis $name:ident: $(extern $($cc:literal)?)? fn($($arg_id:ident: $arg_ty:ty),*) $(-> $ret_ty:ty)? = $lib_name:tt$sep:tt$var:tt$([$add:tt])?;
)*
) => { ... };
}
Expand description
Creates function that resolves its address on the first call.
ⓘ
function! {
// Explicitly defined RVA offset relative to `01-hello` module.
FUNC: extern fn(a: i32) = "01-hello.exe"#0x1900;
}
FUNC.call(5);