diff --git a/crates/texrra-tex-core/src/execution/engine.rs b/crates/texrra-tex-core/src/execution/engine.rs index ace9c29..ce735bd 100644 --- a/crates/texrra-tex-core/src/execution/engine.rs +++ b/crates/texrra-tex-core/src/execution/engine.rs @@ -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>, pdf_space_probe: Option>, pdf_virtual_fonts: Arc, - #[cfg(all(target_os = "linux", target_env = "gnu"))] pdf_last_match: Option>, pdf_catalog_tokens: Vec, pdf_outlines: Vec>>, @@ -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); diff --git a/crates/texrra-tex-core/src/execution/engine/continuation.rs b/crates/texrra-tex-core/src/execution/engine/continuation.rs index dc42c41..5d25757 100644 --- a/crates/texrra-tex-core/src/execution/engine/continuation.rs +++ b/crates/texrra-tex-core/src/execution/engine/continuation.rs @@ -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; } diff --git a/crates/texrra-tex-core/src/execution/mod.rs b/crates/texrra-tex-core/src/execution/mod.rs index 0efb0c1..9da58a1 100644 --- a/crates/texrra-tex-core/src/execution/mod.rs +++ b/crates/texrra-tex-core/src/execution/mod.rs @@ -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, diff --git a/crates/texrra-tex-core/src/execution/state.rs b/crates/texrra-tex-core/src/execution/state.rs index 1562527..f01ad31 100644 --- a/crates/texrra-tex-core/src/execution/state.rs +++ b/crates/texrra-tex-core/src/execution/state.rs @@ -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), diff --git a/crates/texrra-tex-core/tests/execution_pdf_match.rs b/crates/texrra-tex-core/tests/execution_pdf_match.rs index e547279..d189c07 100644 --- a/crates/texrra-tex-core/tests/execution_pdf_match.rs +++ b/crates/texrra-tex-core/tests/execution_pdf_match.rs @@ -1,8 +1,8 @@ -#![cfg(all(target_os = "linux", target_env = "gnu"))] - +#[cfg(all(target_os = "linux", target_env = "gnu"))] use std::{fs, process::Command}; use texrra_tex_core::execution::*; +#[cfg(all(target_os = "linux", target_env = "gnu"))] const SOURCE: &str = r#" \catcode123=1 \catcode125=2 \catcode35=6 \catcode94=7 \def\probe#1{\message{!pdfmatch:#1:end!}} @@ -42,6 +42,7 @@ fn file(source: &str) -> SourceFile { } } +#[cfg(all(target_os = "linux", target_env = "gnu"))] #[test] fn pdf_regex_matches_reference_bytes_and_retains_job_local_captures() { let dir = std::env::temp_dir().join(format!("texrra-pdfmatch-{}", std::process::id())); diff --git a/src/lib.rs b/src/lib.rs index d978469..f57733c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,7 +9,6 @@ mod native_generated; mod native_host; mod native_job; mod native_preview; -#[cfg(all(target_os = "linux", target_env = "gnu"))] mod native_regex; mod native_stream; pub mod rust_typeset; diff --git a/src/native.rs b/src/native.rs index a6cf4eb..6a8cc53 100644 --- a/src/native.rs +++ b/src/native.rs @@ -84,10 +84,7 @@ pub struct CompileRequest { /// internal worker invocation. Call before parsing application arguments, and /// exit with the returned status when the invocation was handled. pub fn dispatch_pdf_regex_worker() -> Option { - #[cfg(all(target_os = "linux", target_env = "gnu"))] - return crate::native_regex::dispatch(); - #[cfg(not(all(target_os = "linux", target_env = "gnu")))] - None + crate::native_regex::dispatch() } #[derive(Clone, Copy, Debug, PartialEq, Eq)] diff --git a/src/native_checkpoint_probe.rs b/src/native_checkpoint_probe.rs index ebb5cdc..f71d50c 100644 --- a/src/native_checkpoint_probe.rs +++ b/src/native_checkpoint_probe.rs @@ -331,13 +331,12 @@ macro_rules! call { } impl SourceProvider for RecordingHost<'_> { - #[cfg(all(target_os = "linux", target_env = "gnu"))] fn match_pdf_regex( &mut self, request: &texrra_tex_core::execution::RegexRequest, cancellation: Option<&Cancellation>, ) -> Result { - // GNU matching consumes only kernel-supplied bytes and is pinned to + // Matching consumes only kernel-supplied bytes and is pinned to // this executable on registered frontends. Its result is kernel state. self.files.match_pdf_regex(request, cancellation) } diff --git a/src/native_job.rs b/src/native_job.rs index a5c7d9a..9a20996 100644 --- a/src/native_job.rs +++ b/src/native_job.rs @@ -223,7 +223,6 @@ struct ReplayState { pub struct Files { world: FileWorld, - #[cfg(all(target_os = "linux", target_env = "gnu"))] regex_worker: Option, cwd: PathBuf, inputs: BTreeMap, @@ -627,7 +626,6 @@ impl Files { preparation.phase = HostPreparationPhase::Ready; Ok(Self { world: stored_world.take().unwrap(), - #[cfg(all(target_os = "linux", target_env = "gnu"))] regex_worker: None, cwd, inputs: BTreeMap::new(), @@ -1667,7 +1665,6 @@ impl Files { } impl SourceProvider for Files { - #[cfg(all(target_os = "linux", target_env = "gnu"))] fn match_pdf_regex( &mut self, request: &texrra_tex_core::execution::RegexRequest,