aboutsummaryrefslogtreecommitdiff
path: root/src/os/mod.rs
diff options
context:
space:
mode:
authorChih-Hung Hsieh <chh@google.com>2020-04-16 10:44:22 -0700
committerChih-Hung Hsieh <chh@google.com>2020-04-16 17:12:19 -0700
commit101fe0ae1d996d38ba7f7e9440b887fa4545f83d (patch)
tree03449542edaf3fb3f4ac85d8291b90b671878ac7 /src/os/mod.rs
parent124dc4a4bf7c4f216a23c1ca8cf5b75f5c35830b (diff)
downloadlibloading-101fe0ae1d996d38ba7f7e9440b887fa4545f83d.tar.gz
Import 'libloading' package vesion 0.6.1
* Add OWNERS Bug: 152884384 Test: make Change-Id: I76e64734e324820f53f083bb4e5fcc7e90a0dfb7
Diffstat (limited to 'src/os/mod.rs')
-rw-r--r--src/os/mod.rs45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/os/mod.rs b/src/os/mod.rs
new file mode 100644
index 0000000..ccbc8e9
--- /dev/null
+++ b/src/os/mod.rs
@@ -0,0 +1,45 @@
+//! Unsafe, platform specific bindings to dynamic library loading facilities.
+//!
+//! These modules expose more extensive, powerful, less principled bindings to the dynamic
+//! library loading facilities. Use of these bindings come at the cost of less (in most cases,
+//! none at all) safety guarantees, which are provided by the top-level bindings.
+//!
+//! # Examples
+//!
+//! Using these modules will likely involve conditional compilation:
+//!
+//! ```ignore
+//! # extern crate libloading;
+//! #[cfg(unix)]
+//! use libloading::os::unix::*;
+//! #[cfg(windows)]
+//! use libloading::os::windows::*;
+//! ```
+
+macro_rules! unix {
+ ($item: item) => {
+ /// UNIX implementation of dynamic library loading.
+ ///
+ /// This module should be expanded with more UNIX-specific functionality in the future.
+ $item
+ }
+}
+
+macro_rules! windows {
+ ($item: item) => {
+ /// Windows implementation of dynamic library loading.
+ ///
+ /// This module should be expanded with more Windows-specific functionality in the future.
+ $item
+ }
+}
+
+#[cfg(unix)]
+unix!(pub mod unix;);
+#[cfg(unix)]
+windows!(pub mod windows {});
+
+#[cfg(windows)]
+windows!(pub mod windows;);
+#[cfg(windows)]
+unix!(pub mod unix {});