1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#![allow(non_camel_case_types, non_upper_case_globals)]
use lazy_static::lazy_static;
mod consts;
mod types;
mod functions {
include!(concat!(env!("OUT_DIR"), "/functions.rs"));
}
pub use consts::*;
pub use types::*;
#[cfg(not(feature = "dynamic_loading"))]
pub use functions::dynamic_linking::*;
#[cfg(feature = "dynamic_loading")]
pub use functions::dynamic_loading::*;
lazy_static! {
static ref LIB_RESULT: Result<libloading::Library, libloading::Error> = unsafe {
log::info!("Loading jack from {}.", JACK_LIB);
libloading::Library::new(JACK_LIB)
};
}
pub fn library() -> Result<&'static libloading::Library, impl std::error::Error> {
LIB_RESULT.as_ref()
}