Enable the portable PDF matching primitives in Windows builds

This commit is contained in:
gloamxun committed 2026-12-02 19:06:53 +08:00
1 parent 2b91828b45
commit cd891494e9
9 files changed
+6 -28

No files matched your search

+1 -10
View File
@@ -36,7 +36,6 @@ mod pdf_image;
mod pdf_form;
mod pdf_objects;
mod pdf_links;
#[cfg(all(target_os = "linux", target_env = "gnu"))]
pub(super) mod pdf_match;
mod quantities;
mod restores;
@@ -278,7 +277,6 @@ pub struct Executor {
pdf_loaded_space_font: Option<Arc<crate::native_font::NativeFont>>,
pdf_space_probe: Option<Arc<page::PdfSpaceProbe>>,
pdf_virtual_fonts: Arc<crate::native_font::JobVirtualFonts>,
#[cfg(all(target_os = "linux", target_env = "gnu"))]
pdf_last_match: Option<Arc<pdf_match::PdfMatch>>,
pdf_catalog_tokens: Vec<Token>,
pdf_outlines: Vec<crate::pdf_device::catalog::PdfOutline<Vec<Token>>>,
@@ -653,7 +651,6 @@ impl Executor {
pdf_loaded_space_font: None,
pdf_space_probe: None,
pdf_virtual_fonts: Default::default(),
#[cfg(all(target_os = "linux", target_env = "gnu"))]
pdf_last_match: None,
pdf_catalog_tokens: Vec::new(),
pdf_outlines: Vec::new(),
@@ -1367,13 +1364,7 @@ impl Executor {
};
self.print_tokens(result, token)?;
}
Pdfmatch | Pdflastmatch => {
#[cfg(all(target_os = "linux", target_env = "gnu"))]
self.expand_pdf_match(primitive, token, files)?;
#[cfg(not(all(target_os = "linux", target_env = "gnu")))]
return self
.fail("pdfTeX regular expressions are unavailable on this host");
}
Pdfmatch | Pdflastmatch => self.expand_pdf_match(primitive, token, files)?,
Pdfuniformdeviate => {
let bound = self.integer(files)?;
self.reads.insert(Dependency::PdfRandomState);
@@ -836,7 +836,6 @@ fn same_kernel_continuation(
$($value,)+
$($planned: _,)+
$($runtime: _,)+
#[cfg(all(target_os = "linux", target_env = "gnu"))]
pdf_last_match: _,
} = current;
true $(&& *$value == prior.$value)+
@@ -927,7 +926,6 @@ fn same_kernel_continuation(
) {
return false;
}
#[cfg(all(target_os = "linux", target_env = "gnu"))]
if current.pdf_last_match.as_deref() != prior.pdf_last_match.as_deref() {
return false;
}
@@ -14,7 +14,6 @@ mod direction;
mod dvi;
pub use direction::DirectionBoundary;
mod engine;
#[cfg(all(target_os = "linux", target_env = "gnu"))]
pub use engine::pdf_match::{RegexOutcome, RegexRequest, match_pdf_regex};
mod font_catalog;
mod fonts;
@@ -235,7 +234,6 @@ pub struct GeneratedInput {
/// File lookup belongs to the host. Execution never shells out to TeX or
/// searches a different engine when a file/primitive is absent.
pub trait SourceProvider {
#[cfg(all(target_os = "linux", target_env = "gnu"))]
fn match_pdf_regex(
&mut self,
request: &RegexRequest,
@@ -1756,9 +1756,7 @@ const PDFTEX_ONLY_PRIMITIVES: &[(&str, Primitive)] = {
("pdfcreationdate", Pdfcreationdate),
("pdfshellescape", Pdfshellescape),
("pdfstrcmp", Pdfstrcmp),
#[cfg(all(target_os = "linux", target_env = "gnu"))]
("pdfmatch", Pdfmatch),
#[cfg(all(target_os = "linux", target_env = "gnu"))]
("pdflastmatch", Pdflastmatch),
("pdfcolorstackinit", Pdfcolorstackinit),
("pdfobj", Pdfobj),