with_abi

Macro with_abi 

Source
macro_rules! with_abi {
    ( $abi:path, $ty:ty ) => { ... };
    ( $abi_lit:literal, $ty:ty ) => { ... };
}
Expand description

Construct a function-pointer type identical to the given one but using the specified ABI.

Accepts either:

  • an Abi value (e.g., Abi::C, Abi::Sysv64), or
  • a string literal (e.g., "C", "system", "stdcall").

ยงExamples

type F = extern "C" fn(i32) -> i32;

type G = with_abi!(Abi::Sysv64, F);
// `G` is `extern "sysv64" fn(i32) -> i32`

type H = with_abi!("C", extern "system" fn());
// `H` is `extern "C" fn()`