From 244c84e4c2ce7a0458a2ff0fd17a53e1f9c878df Mon Sep 17 00:00:00 2001 From: Carlo Bramini <30959007+carlo-bramini@users.noreply.github.com> Date: Wed, 11 Feb 2026 09:43:18 +0100 Subject: [PATCH 1/3] [MESON] Add support for CYGWIN platform --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index a0dfd2196..0ceb55c77 100644 --- a/meson.build +++ b/meson.build @@ -112,7 +112,7 @@ if ['linux', 'freebsd', 'android', 'ios', 'darwin'].contains(system) if ['ios', 'darwin', 'android'].contains(system) cpp_lib = '-lc++' endif -elif system == 'windows' +elif ['windows', 'cygwin'].contains(system) if cpu_family == 'x86' asm_format = 'win32' asm_args += ['-DPREFIX', '-DX86_32'] From 7c4c2db64c1fe23ddb517ddb44728ed8ee27beff Mon Sep 17 00:00:00 2001 From: Carlo Bramini <30959007+carlo-bramini@users.noreply.github.com> Date: Wed, 11 Feb 2026 10:30:55 +0100 Subject: [PATCH 2/3] WIN32: ReleaseSemaphore() needs LONG rather than long. --- codec/decoder/core/src/wels_decoder_thread.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/codec/decoder/core/src/wels_decoder_thread.cpp b/codec/decoder/core/src/wels_decoder_thread.cpp index fdf4b4d70..a607f9e1a 100644 --- a/codec/decoder/core/src/wels_decoder_thread.cpp +++ b/codec/decoder/core/src/wels_decoder_thread.cpp @@ -115,7 +115,10 @@ int SemWait (SWelsDecSemphore* s, int32_t timeout) { } void SemRelease (SWelsDecSemphore* s, long* prevcount) { - ReleaseSemaphore (s->h, 1, prevcount); + LONG _prevcount; + + ReleaseSemaphore (s->h, 1, &_prevcount); + *prevcount = _prevcount; } void SemDestroy (SWelsDecSemphore* s) { From 74f2a54a8ee95fccde7eb98c04daa4ef89b81837 Mon Sep 17 00:00:00 2001 From: Carlo Bramini <30959007+carlo-bramini@users.noreply.github.com> Date: Wed, 11 Feb 2026 10:28:24 +0100 Subject: [PATCH 3/3] CYGWIN: don't use _alloca() for adding stack space. --- codec/decoder/plus/src/welsDecoderExt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codec/decoder/plus/src/welsDecoderExt.cpp b/codec/decoder/plus/src/welsDecoderExt.cpp index 08e037a3d..445978641 100644 --- a/codec/decoder/plus/src/welsDecoderExt.cpp +++ b/codec/decoder/plus/src/welsDecoderExt.cpp @@ -90,7 +90,7 @@ namespace WelsDec { ***************************************************************************/ DECLARE_PROCTHREAD (pThrProcInit, p) { SWelsDecThreadInfo* sThreadInfo = (SWelsDecThreadInfo*)p; -#if defined(WIN32) +#if defined(WIN32) && !defined(__CYGWIN__) _alloca (WELS_DEC_MAX_THREAD_STACK_SIZE * (sThreadInfo->uiThrNum + 1)); #endif return sThreadInfo->pThrProcMain (p);