macro_rules! plugin_abi {
(fn ($($a:tt)*) $($r:tt)*) => { ... };
(unsafe fn ($($a:tt)*) $($r:tt)*) => { ... };
($(#[$($m:tt)*])* $v:vis unsafe fn $($i:tt)*) => { ... };
($(#[$($m:tt)*])* $v:vis fn $($i:tt)*) => { ... };
}Expand description
The calling convention of plugins and modules: extern "win64" on x86-64, extern "C"
elsewhere (docs/ARM64.md, decision 4). plugin_abi!(fn(u32) -> u32) is the type of such a
function pointer; plugin_abi! { pub fn f(a: u32) -> u32 { a } } defines such a function
(attributes, visibility, unsafe, generics and the body pass through unchanged).