#![allow(non_snake_case, non_camel_case_types, clippy::too_many_arguments)]
pub use libloading::Error as LoadError;
use std::{mem::ManuallyDrop, path::Path};
pub mod types;
pub use types::*;
mod generated;
pub use generated::*;
pub(crate) unsafe fn open(path: &Path) -> Result<ManuallyDrop<libloading::Library>, LoadError> {
#[cfg(windows)]
let library = libloading::os::windows::Library::load_with_flags(
path,
libloading::os::windows::LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR
| libloading::os::windows::LOAD_LIBRARY_SEARCH_DEFAULT_DIRS,
)?
.into();
#[cfg(not(windows))]
let library = libloading::Library::new(path)?;
Ok(ManuallyDrop::new(library))
}