Attribute Macro directcpp::bridge

source ·
#[bridge]
Expand description

Generate bridge code for C++ functions.

§Examples

#[bridge]
extern "C++" {
	pub fn cpp_ptr(xx:i32) -> SharedPtr<CppStruct>;
}

This generates the following code:

extern "C" {
    #[link_name = "?on_start@@YAXXZ"]
    fn ffi__on_start();
}
pub fn on_start() { unsafe { ffi__on_start() } }

See the README for more details.