Skip to content

Commit ed1d471

Browse files
Fix build on windows-2022 and windows-2025 (visual studio 2022) (#139)
1 parent dd25c6d commit ed1d471

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
os: [ubuntu-latest, macos-latest, windows-2019]
34+
os: [ubuntu-latest, macos-latest, windows-2019, windows-2022, windows-2025]
3535
steps:
3636
- uses: actions/checkout@v3
3737
with:

mupdf-sys/build.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,12 @@ fn build_libmupdf() {
246246
fn build_libmupdf() {
247247
use cc::windows_registry::find_vs_version;
248248

249+
// Patch geometry.c to compile on vs 2022
250+
let file_path = "mupdf/source/fitz/geometry.c";
251+
let content = fs::read_to_string(file_path).expect("Failed to read geometry.c file");
252+
let patched_content = content.replace("NAN", "(0.0/0.0)");
253+
fs::write(file_path, patched_content).expect("Failed to write patched geometry.c file");
254+
249255
let target = env::var("TARGET").expect("TARGET not found in environment");
250256
let msvc_platform = if target.contains("x86_64") {
251257
"x64"

0 commit comments

Comments
 (0)