From 8cbb9d8328c7d4a8ff3bd2abb41cdfe292e56e02 Mon Sep 17 00:00:00 2001 From: Jeffrey 'Alex' Clark Date: Thu, 19 Nov 2026 22:29:13 -0500 Subject: [PATCH 1/2] Use dav1d 1.5.5 when building libavif on Windows libavif 1.4.2 builds dav1d 1.5.3, whose MSVC stdatomic.h compat header fails to compile with MSVC 19.52 (error C7780: function-like macro '__has_include_next' is not defined). This is fixed in dav1d 1.5.5. Co-Authored-By: Claude Opus 5.5 --- winbuild/build_prepare.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/winbuild/build_prepare.py b/winbuild/build_prepare.py index ea881f00ff7..c5069e7a5c0 100644 --- a/winbuild/build_prepare.py +++ b/winbuild/build_prepare.py @@ -434,6 +434,12 @@ def get_python_architecture() -> str: "url": f"https://github.com/AOMediaCodec/libavif/archive/v{V['libavif']}.tar.gz", "filename": f"libavif-{V['libavif']}.tar.gz", "license": "LICENSE", + "patch": { + r"cmake\Modules\LocalDav1d.cmake": { + # dav1d 1.5.5 fixes building with MSVC 19.52 and later + 'set(AVIF_DAV1D_TAG "1.5.3")': 'set(AVIF_DAV1D_TAG "1.5.5")', + }, + }, "build": [ "rustup update", f"{sys.executable} -m pip install meson", From c755114baabda1869f3e3825b55665b9a4dc146b Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Fri, 20 Nov 2026 15:56:54 +1100 Subject: [PATCH 2/2] Use uint8_t to fix intermittent output change on Windows --- src/libImaging/BcnDecode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libImaging/BcnDecode.c b/src/libImaging/BcnDecode.c index 809dd500bc7..8d02cdc55c0 100644 --- a/src/libImaging/BcnDecode.c +++ b/src/libImaging/BcnDecode.c @@ -344,7 +344,7 @@ decode_bc7_block(rgba *col, const UINT8 *src) { int mode = src[0]; int i, j; int numep, cb, ab, ib, ib2, i0, i1, s; - int8_t bit = 0; + uint8_t bit = 0; UINT8 index_sel, partition, rotation, val; const char *cw, *aw; const bc7_mode_info *info;