fix: use c_char instead of i8/u8

This commit is contained in:
Kingtous
2023-04-10 16:54:50 +08:00
parent 1883c05b76
commit dc7692952b
2 changed files with 8 additions and 6 deletions

View File

@@ -1,8 +1,10 @@
use std::ffi::c_char;
use crate::plugins::PLUGIN_REGISTRAR;
// API provided by RustDesk.
pub type LoadPluginFunc = fn(*const i8) -> i32;
pub type UnloadPluginFunc = fn(*const i8) -> i32;
pub type LoadPluginFunc = fn(*const c_char) -> i32;
pub type UnloadPluginFunc = fn(*const c_char) -> i32;
#[repr(C)]
pub struct RustDeskApiTable {
@@ -11,12 +13,12 @@ pub struct RustDeskApiTable {
}
#[no_mangle]
fn load_plugin(path: *const i8) -> i32 {
fn load_plugin(path: *const c_char) -> i32 {
PLUGIN_REGISTRAR.load_plugin(path)
}
#[no_mangle]
fn unload_plugin(path: *const i8) -> i32 {
fn unload_plugin(path: *const c_char) -> i32 {
PLUGIN_REGISTRAR.unload_plugin(path)
}