libloading/os/mod.rs
1//! Unsafe, platform specific bindings to dynamic library loading facilities.
2//!
3//! These modules expose more extensive, powerful, less principled bindings to the dynamic
4//! library loading facilities. Use of these bindings come at the cost of less (in most cases,
5//! none at all) safety guarantees, which are provided by the top-level bindings.
6//!
7//! # Examples
8//!
9//! Using these modules will likely involve conditional compilation:
10//!
11//! ```ignore
12//! # extern crate libloading;
13//! #[cfg(unix)]
14//! use libloading::os::unix::*;
15//! #[cfg(windows)]
16//! use libloading::os::windows::*;
17//! ```
18
19macro_rules! unix {
20 ($item: item) => {
21 /// UNIX implementation of dynamic library loading.
22 ///
23 /// This module should be expanded with more UNIX-specific functionality in the future.
24 $item
25 }
26}
27
28macro_rules! windows {
29 ($item: item) => {
30 /// Windows implementation of dynamic library loading.
31 ///
32 /// This module should be expanded with more Windows-specific functionality in the future.
33 $item
34 }
35}
36
37#[cfg(unix)]
38unix!(pub mod unix;);
39#[cfg(unix)]
40windows!(pub mod windows {});
41
42#[cfg(windows)]
43windows!(pub mod windows;);
44#[cfg(windows)]
45unix!(pub mod unix {});