diff --git a/examples/custom_plugin/Cargo.toml b/examples/custom_plugin/Cargo.toml index 106e48ebb..b9ee06ae7 100644 --- a/examples/custom_plugin/Cargo.toml +++ b/examples/custom_plugin/Cargo.toml @@ -10,9 +10,14 @@ name = "custom_plugin" path = "src/lib.rs" crate-type = ["cdylib"] + +[features] +default = ["flutter"] +flutter = [] + [dependencies] lazy_static = "1.4.0" -rustdesk = { path = "../../", version = "1.2.0"} +rustdesk = { path = "../../", version = "1.2.0", features = ["flutter"]} [profile.release] lto = true diff --git a/examples/custom_plugin/src/lib.rs b/examples/custom_plugin/src/lib.rs index be051c1d9..860e0366a 100644 --- a/examples/custom_plugin/src/lib.rs +++ b/examples/custom_plugin/src/lib.rs @@ -9,6 +9,8 @@ lazy_static::lazy_static! { pub static ref API: RustDeskApiTable = RustDeskApiTable::default(); } + + #[no_mangle] fn plugin_name() -> *const c_char { return PLUGIN_NAME.as_ptr(); diff --git a/src/plugins.rs b/src/plugins.rs index 3235bce4a..dfbdc7753 100644 --- a/src/plugins.rs +++ b/src/plugins.rs @@ -36,8 +36,8 @@ pub trait Plugin { #[repr(C)] #[derive(Default, Clone)] pub struct RustDeskPluginTable { - pub init: Option, - pub dispose: Option, + pub init: Option, // NonNull + pub dispose: Option, // NonNull } pub struct PluginImpl {