mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-30 13:51:13 +00:00
Smaller workaround for the fact that some function are not exported
This commit is contained in:
parent
f1d9f4a04e
commit
debd2b5839
6 changed files with 19 additions and 43 deletions
|
@ -190,14 +190,3 @@ pub unsafe extern "C" fn sixtyfps_shared_array_drop(out: *mut SharedArray<u8>) {
|
|||
// ?? This won't call drop on the right type...
|
||||
core::ptr::read(out);
|
||||
}
|
||||
|
||||
/// Somehow this is required for the extern "C" things to be exported in a dependent dynlib
|
||||
#[doc(hidden)]
|
||||
pub fn dummy() {
|
||||
#[derive(Clone)]
|
||||
struct Foo;
|
||||
foo(Foo);
|
||||
fn foo(f: impl Clone) {
|
||||
let _ = f.clone();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -112,14 +112,3 @@ pub unsafe extern "C" fn sixtyfps_signal_set_handler(
|
|||
pub unsafe extern "C" fn sixtyfps_signal_drop(handle: *mut SignalOpaque) {
|
||||
core::ptr::read(handle as *mut Signal<()>);
|
||||
}
|
||||
|
||||
/// Somehow this is required for the extern "C" things to be exported in a dependent dynlib
|
||||
#[doc(hidden)]
|
||||
pub fn dummy() {
|
||||
#[derive(Clone)]
|
||||
struct Foo;
|
||||
foo(Foo);
|
||||
fn foo(f: impl Clone) {
|
||||
let _ = f.clone();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,14 +12,3 @@ pub extern "C" fn sixtyfps_test_ellapse_time(time_in_ms: u64) {
|
|||
driver.update_animations(tick)
|
||||
})
|
||||
}
|
||||
|
||||
/// Somehow this is required for the extern "C" things to be exported in a dependent dynlib
|
||||
#[doc(hidden)]
|
||||
pub fn dummy() {
|
||||
#[derive(Clone)]
|
||||
struct Foo;
|
||||
foo(Foo);
|
||||
fn foo(f: impl Clone) {
|
||||
let _ = f.clone();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -246,13 +246,3 @@ pub extern "C" fn solve_path_layout(data: &PathLayoutData) {
|
|||
}
|
||||
}
|
||||
|
||||
/// Somehow this is required for the extern "C" things to be exported in a dependent dynlib
|
||||
#[doc(hidden)]
|
||||
pub fn dummy() {
|
||||
#[derive(Clone)]
|
||||
struct Foo;
|
||||
foo(Foo);
|
||||
fn foo(f: impl Clone) {
|
||||
let _ = f.clone();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,3 +61,15 @@ pub type ComponentRefPin<'a> = core::pin::Pin<abi::datastructures::ComponentRef<
|
|||
|
||||
pub mod eventloop;
|
||||
mod item_rendering;
|
||||
|
||||
/// One need to use at least one function in each module in order to get them
|
||||
/// exported in the final binary.
|
||||
/// This only use functions from modules which are not otherwise used.
|
||||
#[doc(hidden)]
|
||||
#[cold]
|
||||
pub fn use_modules() -> usize {
|
||||
abi::tests::sixtyfps_test_ellapse_time as usize
|
||||
+ abi::signals::sixtyfps_signal_init as usize
|
||||
+ abi::sharedarray::sixtyfps_shared_array_drop as usize
|
||||
+ layout::solve_grid_layout as usize
|
||||
}
|
||||
|
|
|
@ -730,3 +730,10 @@ pub fn create_gl_window() -> ComponentWindow {
|
|||
GLRenderer::new(&event_loop.get_winit_event_loop(), window_builder)
|
||||
}))
|
||||
}
|
||||
|
||||
|
||||
#[doc(hidden)]
|
||||
#[cold]
|
||||
pub fn use_modules() {
|
||||
sixtyfps_corelib::use_modules();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue