pub fn enable_pam_impl_cfg()Expand description
Generates cargo directives for build scripts to enable cfg(pam_impl).
Print this in your build.rs script to be able to use the custom pam_impl
configuration directive.
// Your package's build.rs:
fn main() {
// Also available at libpam_sys::pam_impl::enable_pam_impl_cfg().
libpam_sys_impls::enable_pam_impl_cfg();
// whatever else you do in your build script.
}This will set the current pam_impl as well as registering all known
PAM implementations with rustc-check-cfg to get cfg-checking.
The names that appear in the cfg variables are the same as the values
in the PamImpl enum.
ⓘ
#[cfg(pam_impl = "OpenPam")]
fn openpam_specific_func(handle: *const libpam_sys::pam_handle) {
let environ = libpam_sys::pam_getenvlist(handle);
// ...
libpam_sys::openpam_free_envlist()
}
// This will give you a warning since "UnknownImpl" is not a known
// PAM implementation.
#[cfg(not(pam_impl = "UnknownImpl"))]
fn do_something() {
// ...
}