macro_rules! EXTERN_SYM_PTR {
($vis:vis $name:ident , $ext:ident) => { ... };
($vis:vis $name:ident : $ty:ty = $ext:ident) => { ... };
}Expand description
macro to declare a external symbol: cast its address into e.g. u64. useful for getting the address of a tag in asm.
tag:
// somethingEXTERN_SYM_PTR!(_TAG, tag)
becomes
extern "C" {
fn tag();
}
const TAG: *const () = tag as *const ();