Mercurial > crates > nonstick
comparison libpam-sys/libpam-sys-test/build.rs @ 148:4b3a5095f68c
Move libpam-sys helpers into their own library.
- Renames libpam-sys-helpers to libpam-sys-consts.
- Moves libpam-sys-helpers::helpers into libpam-sys-helpers,
which moves them completely out of libpam-sys's dependency chain.
- Moves the aliases from libpam-sys into libpam-sys::aliases.
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Mon, 07 Jul 2025 12:11:43 -0400 |
parents | 33b9622ed6d2 |
children | 3a7cf05d2b5f |
comparison
equal
deleted
inserted
replaced
147:4d7333337569 | 148:4b3a5095f68c |
---|---|
1 use bindgen::MacroTypeVariation; | 1 use bindgen::MacroTypeVariation; |
2 use libpam_sys_helpers::pam_impl::PamImpl; | 2 use libpam_sys_consts::pam_impl::PamImpl; |
3 use libpam_sys_helpers::{pam_impl, pam_impl_name}; | 3 use libpam_sys_consts::{pam_impl, pam_impl_name}; |
4 use proc_macro2::{Group, Ident, TokenStream, TokenTree}; | 4 use proc_macro2::{Group, Ident, TokenStream, TokenTree}; |
5 use quote::{format_ident, ToTokens}; | 5 use quote::{format_ident, ToTokens}; |
6 use std::path::Path; | 6 use std::path::Path; |
7 use std::process::Command; | 7 use std::process::Command; |
8 use std::str::FromStr; | 8 use std::str::FromStr; |
182 match token { | 182 match token { |
183 TokenTree::Group(g) => { | 183 TokenTree::Group(g) => { |
184 TokenTree::Group(Group::new(g.delimiter(), deconstify(g.stream(), mut_token))) | 184 TokenTree::Group(Group::new(g.delimiter(), deconstify(g.stream(), mut_token))) |
185 .into_token_stream() | 185 .into_token_stream() |
186 } | 186 } |
187 // Remove all 'consts' from the file and replace them with 'mut'. | |
187 TokenTree::Ident(id) if id == "const" => mut_token.into_token_stream(), | 188 TokenTree::Ident(id) if id == "const" => mut_token.into_token_stream(), |
188 other => other.into_token_stream(), | 189 other => other.into_token_stream(), |
189 } | 190 } |
190 })) | 191 })) |
191 } | 192 } |
193 | |
194 enum ItemOr {} | |
192 | 195 |
193 fn test_file(name: impl AsRef<str>) -> String { | 196 fn test_file(name: impl AsRef<str>) -> String { |
194 format!("{}/{}", env::var("OUT_DIR").unwrap(), name.as_ref()) | 197 format!("{}/{}", env::var("OUT_DIR").unwrap(), name.as_ref()) |
195 } | 198 } |
196 | 199 |