From 5e978d4fd274cbb185123a6fccb012da1a16bfeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 20 Nov 2025 21:33:33 +0100 Subject: [PATCH] libmpcdec: Fix build with MSVC --- thirdparty/libmpcdec/mpc_bits_reader.c | 6 +++--- thirdparty/libmpcdec/patches/msvc-log2.patch | Bin 0 -> 2348 bytes 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 thirdparty/libmpcdec/patches/msvc-log2.patch diff --git a/thirdparty/libmpcdec/mpc_bits_reader.c b/thirdparty/libmpcdec/mpc_bits_reader.c index 5281288d255..c4199eb3fa4 100644 --- a/thirdparty/libmpcdec/mpc_bits_reader.c +++ b/thirdparty/libmpcdec/mpc_bits_reader.c @@ -98,7 +98,7 @@ const mpc_uint32_t Cnk_lost[MAX_ENUM / 2][MAX_ENUM] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 103, 55, 3347, 12419, 56459, 16987, 313105, 54177, 3076873, 3739321, 3132677, 66353813, 123012781, 236330717} }; -static const mpc_uint8_t log2[32] = +static const mpc_uint8_t mpc_log2[32] = { 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6}; static const mpc_uint8_t log2_lost[32] = @@ -136,8 +136,8 @@ mpc_int32_t mpc_bits_golomb_dec(mpc_bits_reader * r, const mpc_uint_t k) mpc_uint32_t mpc_bits_log_dec(mpc_bits_reader * r, mpc_uint_t max) { mpc_uint32_t value = 0; - if (log2[max - 1] > 1) - value = mpc_bits_read(r, log2[max - 1] - 1); + if (mpc_log2[max - 1] > 1) + value = mpc_bits_read(r, mpc_log2[max - 1] - 1); if (value >= log2_lost[max - 1]) value = ((value << 1) | mpc_bits_read(r, 1)) - log2_lost[max - 1]; return value; diff --git a/thirdparty/libmpcdec/patches/msvc-log2.patch b/thirdparty/libmpcdec/patches/msvc-log2.patch new file mode 100644 index 0000000000000000000000000000000000000000..09363fc9a5d95a1d475095424d5effd8fab9309b GIT binary patch literal 2348 zcmcJRU2jrB5QgU#6aT|rf~T~cbNDj0O^xwV?@UZcL$F0`3Th~tn%ci!eP(u-v&9yX zNH#39v$Hd^?>js2>+W1GS;*xr;ny#`3@Uiq-R&PY3hLiN8}dN6b`{%5AgUeD<90ZtjA6inrSWqliuVlI|lP z->g<#7XB>%?5qEA3tg9p69WJF2 z>M%zCvxCH)Dld=4HW@`