Mercurial > crates > nonstick
diff libpam-sys/src/lib.rs @ 108:e97534be35e3
Make some proc macros for doing cfg-like stuff for PAM impls.
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Sat, 28 Jun 2025 00:34:45 -0400 |
parents | 49d9e2b5c189 |
children | bb465393621f |
line wrap: on
line diff
--- a/libpam-sys/src/lib.rs Thu Jun 26 22:42:32 2025 -0400 +++ b/libpam-sys/src/lib.rs Sat Jun 28 00:34:45 2025 -0400 @@ -1,22 +1,25 @@ #![doc = include_str!("../README.md")] //! -//! ## Version info -//! -//! This documentation was built with the following configuration: -//! -#![cfg_attr(pam_impl = "illumos", doc = "- PAM implementation: Illumos")] -#![cfg_attr(pam_impl = "linux-pam", doc = "- PAM implementation: Linux-PAM")] -#![cfg_attr(pam_impl = "openpam", doc = "- PAM implementation: OpenPAM")] +//! ## PAM implementation //! -#![cfg_attr(feature = "basic-ext", doc = "- Includes common extensions")] -#![cfg_attr(feature = "linux-pam-ext", doc = "- Includes Linux-PAM extensions")] -#![cfg_attr(feature = "openpam-ext", doc = "- Includes OpenPAM extensions")] -#![cfg_attr( - feature = "use-system-headers", - doc = "- Built with system header files" -)] +#![doc = concat!("This documentation was built for the **", pam_impl_name!(), "** implementation.")] + mod constants; + +libpam_sys_impls::pam_impl_enum!(); + +#[doc(inline)] +pub use libpam_sys_impls::{cfg_pam_impl, pam_impl_name}; + pub mod helpers; #[doc(inline)] pub use constants::*; + +#[cfg(test)] +mod tests { + #[test] + fn test() { + panic!("The pam impl is {:?}", super::LIBPAMSYS_IMPL); + } +}