diff libpam-sys/libpam-sys-test/build.rs @ 134:6c1e1bdb4164

Use standard #[cfg] directives rather than custom proc macros. Instead of having to do a bunch of custom parsing and other logic that tools often choke on, this change introduces an easy way to depend upon custom #[cfg]s provided by the libpam-sys crate.
author Paul Fisher <paul@pfish.zone>
date Thu, 03 Jul 2025 11:03:36 -0400
parents 0b6a17f8c894
children efbc235f01d3
line wrap: on
line diff
--- a/libpam-sys/libpam-sys-test/build.rs	Wed Jul 02 03:33:09 2025 -0400
+++ b/libpam-sys/libpam-sys-test/build.rs	Thu Jul 03 11:03:36 2025 -0400
@@ -1,5 +1,5 @@
 use bindgen::MacroTypeVariation;
-use libpam_sys_impls::__pam_impl_enum__;
+use libpam_sys::pam_impl::PamImpl;
 use proc_macro2::{Group, Ident, TokenStream, TokenTree};
 use quote::{format_ident, ToTokens};
 use std::path::Path;
@@ -8,9 +8,6 @@
 use std::{env, fs};
 use syn::{Item, ItemConst};
 
-// We're using the macro directly so we can match exhaustively.
-__pam_impl_enum__!();
-
 const REDIR_FD: &str = "pam_modutil_redirect_fd";
 
 fn main() {
@@ -49,6 +46,7 @@
             headers: vec!["\"xsso_pam_appl.h\""],
             ..Default::default()
         },
+        other => panic!("PAM implementation {other:?} is not yet tested"),
     };
     generate_const_test(&config);
     generate_ctest(&config);