add another export interface,STDcall,windows dll
It is best to add another export interface to generate the WINDOWS standard DLL standard STDcall convention
cargo build --target=i686-pc-windows-msvc --release FOR X64 cargo build --release
pub extern "stdcall" fn pollnet_version() -> *const c_char { VERSION_STR.as_ptr() as *const c_char }
#[no_mangle] pub unsafe extern "stdcall" fn pollnet_open_ws(ctx: *mut PollnetContext, url: *const c_char) -> u64 { let ctx = unsafe { &mut *ctx }; let url = c_str_to_string(url); ctx.open_ws(url).into() }
/// # Safety /// /// ctx must be valid #[no_mangle] pub unsafe extern "stdcall" fn pollnet_listen_ws(ctx: *mut PollnetContext, addr: *const c_char) -> u64 { let ctx = unsafe { &mut *ctx }; let addr = c_str_to_string(addr); ctx.listen_ws(addr).into() }