1#![allow(non_snake_case, non_camel_case_types, clippy::too_many_arguments)]
4
5pub use libloading::Error as LoadError;
6use std::{mem::ManuallyDrop, path::Path};
7pub mod types;
8pub use types::*;
9mod generated;
10pub use generated::*;
11pub mod globe;
12pub use globe::GlobeApi;
13
14pub(crate) unsafe fn open(path: &Path) -> Result<ManuallyDrop<libloading::Library>, LoadError> {
17 #[cfg(windows)]
18 let library = libloading::os::windows::Library::load_with_flags(
19 path,
20 libloading::os::windows::LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR
21 | libloading::os::windows::LOAD_LIBRARY_SEARCH_DEFAULT_DIRS,
22 )?
23 .into();
24 #[cfg(not(windows))]
25 let library = libloading::Library::new(path)?;
26 Ok(ManuallyDrop::new(library))
27}