Re: [Mingw-w64-public] [PATCH 14/18] winpthreads: AC_PROG_RANLIB is obsoleted by LT_INIT

2023-11-29 Thread JonY via Mingw-w64-public
On 11/29/23 10:39, Antonin Décimo wrote: Fixes a warning from libtoolize: 'AC_PROG_RANLIB' is rendered obsolete by 'LT_INIT'. Signed-off-by: Antonin Décimo --- mingw-w64-libraries/winpthreads/configure| 104 +-- mingw-w64-libraries/winpthreads/configure.ac | 1 - 2 fil

Re: [Mingw-w64-public] [PATCH 04/18] winpthreads: Format error string with snprintf

2023-11-29 Thread Antonin Décimo
Le mer. 29 nov. 2023 à 17:26, Martin Storsjö a écrit : > > On Wed, 29 Nov 2023, LIU Hao wrote: > > > 在 2023/11/29 18:38, Antonin Décimo 写道: > >> Previous code was too complex and hard to understand, and snprintf > >> fits the job nicely. > >> > >> Signed-off-by: Antonin Décimo > >> --- > >> min

Re: [Mingw-w64-public] headers: Import mfmediaengine.idl from wine.

2023-11-29 Thread Nikolay Sivov
Ah, I somehow missed it. Thank you. On Wed, Nov 29, 2023 at 6:49 PM Jacek Caban wrote: > On 29.11.2023 18:35, Nikolay Sivov wrote: > > import "mfobjects.idl"; > +import "mftransform.idl"; > > cpp_quote("#include ") // FIXME: import "mftransform.idl"; > > > This cpp_quote should be removed now.

Re: [Mingw-w64-public] headers: Import mfmediaengine.idl from wine.

2023-11-29 Thread Jacek Caban
On 29.11.2023 18:35, Nikolay Sivov wrote: import "mfobjects.idl"; +import "mftransform.idl"; cpp_quote("#include ") // FIXME: import "mftransform.idl"; This cpp_quote should be removed now. I fixed that and pushed. Thanks, Jacek ___ Mingw-w6

Re: [Mingw-w64-public] [PATCH 04/18] winpthreads: Format error string with snprintf

2023-11-29 Thread Martin Storsjö
On Wed, 29 Nov 2023, LIU Hao wrote: 在 2023/11/29 18:38, Antonin Décimo 写道: Previous code was too complex and hard to understand, and snprintf fits the job nicely. Signed-off-by: Antonin Décimo --- mingw-w64-libraries/winpthreads/src/thread.c | 21 1 file changed, 4 i

Re: [Mingw-w64-public] [PATCH 04/18] winpthreads: Format error string with snprintf

2023-11-29 Thread LIU Hao
在 2023/11/29 18:38, Antonin Décimo 写道: Previous code was too complex and hard to understand, and snprintf fits the job nicely. Signed-off-by: Antonin Décimo --- mingw-w64-libraries/winpthreads/src/thread.c | 21 1 file changed, 4 insertions(+), 17 deletions(-) +

Re: [Mingw-w64-public] [PATCH] headers: include some IEC61937 GUID

2023-11-29 Thread LIU Hao
在 2023/11/29 19:04, Steve Lhomme 写道: +#define STATIC_KSDATAFORMAT_SUBTYPE_IEC61937_DOLBY_DIGITAL \ + DEFINE_WAVEFORMATEX_GUID(WAVE_FORMAT_DOLBY_AC3_SPDIF) +DEFINE_GUIDSTRUCT("0092--0010-8000-00aa00389b71",KSDATAFORMAT_SUBTYPE_IEC61937_DOLBY_DIGITAL); +#define KSDATAFORMAT_SUBTYP

Re: [Mingw-w64-public] [PATCH 07/18] winpthreads: Fix TLS thread callback initializers on MSVC x64

2023-11-29 Thread Martin Storsjö
On Wed, 29 Nov 2023, Antonin Décimo wrote: Thanks a lot for clarifying. I couldn't find any documentation about this, apart from blog posts [1] Right, see how the blog post uses #ifdef _M_AMD64 and #ifdef _M_IX86 to strictly distinguish what they mean here. and related code in Chromium [2]

Re: [Mingw-w64-public] [PATCH 07/18] winpthreads: Fix TLS thread callback initializers on MSVC x64

2023-11-29 Thread Antonin Décimo
Le mer. 29 nov. 2023 à 13:21, Martin Storsjö a écrit : > > On Wed, 29 Nov 2023, Antonin Décimo wrote: > > > Le mer. 29 nov. 2023 à 12:32, Martin Storsjö a écrit : > >> > >> On Wed, 29 Nov 2023, Antonin Décimo wrote: > >> > >> > Signed-off-by: Antonin Décimo > >> > --- > >> > mingw-w64-libraries/

Re: [Mingw-w64-public] [PATCH 15/18] winpthreads: Add windres-rc, a wrapper for windres to rc

2023-11-29 Thread Martin Storsjö
On Wed, 29 Nov 2023, Antonin Décimo wrote: Le mer. 29 nov. 2023 à 12:42, Martin Storsjö a écrit : On Wed, 29 Nov 2023, Antonin Décimo wrote: > Signed-off-by: Antonin Décimo > --- > .../winpthreads/build-aux/windres-rc | 158 ++ > mingw-w64-libraries/winpthreads/confi

Re: [Mingw-w64-public] [PATCH 15/18] winpthreads: Add windres-rc, a wrapper for windres to rc

2023-11-29 Thread Antonin Décimo
Le mer. 29 nov. 2023 à 12:42, Martin Storsjö a écrit : > > On Wed, 29 Nov 2023, Antonin Décimo wrote: > > > Signed-off-by: Antonin Décimo > > --- > > .../winpthreads/build-aux/windres-rc | 158 ++ > > mingw-w64-libraries/winpthreads/configure | 13 +- > > mingw-w64-lib

Re: [Mingw-w64-public] [PATCH 07/18] winpthreads: Fix TLS thread callback initializers on MSVC x64

2023-11-29 Thread Martin Storsjö
On Wed, 29 Nov 2023, Antonin Décimo wrote: Le mer. 29 nov. 2023 à 12:32, Martin Storsjö a écrit : On Wed, 29 Nov 2023, Antonin Décimo wrote: > Signed-off-by: Antonin Décimo > --- > mingw-w64-libraries/winpthreads/src/thread.c | 18 -- > 1 file changed, 16 insertions(+), 2 del

Re: [Mingw-w64-public] [PATCH 12/18] winpthreads: Fix include style

2023-11-29 Thread Antonin Décimo
> (while it probably can be considered belonging to the general theme of the > subject line of the patch). This was my intent. > If you'd add a separate pargraph to the commit > message explaining the reasoning for this one, it can probably be fine to > keep both in the same commit. Ok! __

Re: [Mingw-w64-public] [PATCH 08/18] winpthreads: Use __assume(0) MSVC builtin for unreachable code

2023-11-29 Thread Antonin Décimo
Le mer. 29 nov. 2023 à 12:34, Martin Storsjö a écrit : > > On Wed, 29 Nov 2023, Antonin Décimo wrote: > > > https://learn.microsoft.com/en-us/cpp/intrinsics/assume?view=msvc-170 > > > > Signed-off-by: Antonin Décimo > > --- > > mingw-w64-libraries/winpthreads/src/mutex.c | 4 > > 1 file chang

Re: [Mingw-w64-public] [PATCH 05/18] winpthreads: Use _strdup variant instead of strdup

2023-11-29 Thread Antonin Décimo
Le mer. 29 nov. 2023 à 12:29, Martin Storsjö a écrit : > > On Wed, 29 Nov 2023, Antonin Décimo wrote: > > > Microsoft considers these POSIX function names to be deprecated, and > > provides alternative names starting with an underscore. A deprecation > > warning is raised if the old names are used

Re: [Mingw-w64-public] [PATCH 07/18] winpthreads: Fix TLS thread callback initializers on MSVC x64

2023-11-29 Thread Antonin Décimo
Le mer. 29 nov. 2023 à 12:32, Martin Storsjö a écrit : > > On Wed, 29 Nov 2023, Antonin Décimo wrote: > > > Signed-off-by: Antonin Décimo > > --- > > mingw-w64-libraries/winpthreads/src/thread.c | 18 -- > > 1 file changed, 16 insertions(+), 2 deletions(-) > > > > diff --git a/ming

Re: [Mingw-w64-public] [PATCH 15/18] winpthreads: Add windres-rc, a wrapper for windres to rc

2023-11-29 Thread Martin Storsjö
On Wed, 29 Nov 2023, Antonin Décimo wrote: Signed-off-by: Antonin Décimo --- .../winpthreads/build-aux/windres-rc | 158 ++ mingw-w64-libraries/winpthreads/configure | 13 +- mingw-w64-libraries/winpthreads/configure.ac | 8 +- .../winpthreads/src/version.rc

Re: [Mingw-w64-public] [PATCH 12/18] winpthreads: Fix include style

2023-11-29 Thread Martin Storsjö
On Wed, 29 Nov 2023, Antonin Décimo wrote: MSVC warns against relative path in include directives. warning C4464: relative include path contains '..' https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4464?view=msvc-170 Signed-off-by: Antonin Décimo

Re: [Mingw-w64-public] [PATCH 08/18] winpthreads: Use __assume(0) MSVC builtin for unreachable code

2023-11-29 Thread Martin Storsjö
On Wed, 29 Nov 2023, Antonin Décimo wrote: https://learn.microsoft.com/en-us/cpp/intrinsics/assume?view=msvc-170 Signed-off-by: Antonin Décimo --- mingw-w64-libraries/winpthreads/src/mutex.c | 4 1 file changed, 4 insertions(+) diff --git a/mingw-w64-libraries/winpthreads/src/mutex.c b/m

Re: [Mingw-w64-public] [PATCH 07/18] winpthreads: Fix TLS thread callback initializers on MSVC x64

2023-11-29 Thread Martin Storsjö
On Wed, 29 Nov 2023, Antonin Décimo wrote: Signed-off-by: Antonin Décimo --- mingw-w64-libraries/winpthreads/src/thread.c | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/mingw-w64-libraries/winpthreads/src/thread.c b/mingw-w64-libraries/winpthreads/src/th

Re: [Mingw-w64-public] [PATCH 05/18] winpthreads: Use _strdup variant instead of strdup

2023-11-29 Thread Martin Storsjö
On Wed, 29 Nov 2023, Antonin Décimo wrote: Microsoft considers these POSIX function names to be deprecated, and provides alternative names starting with an underscore. A deprecation warning is raised if the old names are used, which can alternatively be disabled with the _CRT_NONSTDC_NO_WARNINGS

[Mingw-w64-public] [PATCH] headers: add WAVEFORMATEXTENSIBLE_IEC61937

2023-11-29 Thread Steve Lhomme
This is used for HDMI passthrough [1]. [1] https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ksmedia/ns-ksmedia-waveformatextensible_iec61937 --- mingw-w64-headers/include/ksmedia.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/mingw-w64-headers/include/ksmedia.h

[Mingw-w64-public] [PATCH] headers: include some IEC61937 GUID

2023-11-29 Thread Steve Lhomme
This is used for HDMI passthrough. --- mingw-w64-headers/include/ksmedia.h | 27 ++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/mingw-w64-headers/include/ksmedia.h b/mingw-w64-headers/include/ksmedia.h index c3f98a53b..cffb63800 100644 --- a/mingw-w64-he

[Mingw-w64-public] [PATCH 09/18] winpthreads: Fix printf format specifiers

2023-11-29 Thread Antonin Décimo
As DWORD is a typedef for unsigned long, we can use the %lu format specifier. The %p format specifier requires (void *) pointers. Signed-off-by: Antonin Décimo --- mingw-w64-libraries/winpthreads/src/cond.c | 6 +++--- mingw-w64-libraries/winpthreads/src/rwlock.c | 6 +++--- mingw-w64-librar

[Mingw-w64-public] [PATCH 14/18] winpthreads: AC_PROG_RANLIB is obsoleted by LT_INIT

2023-11-29 Thread Antonin Décimo
Fixes a warning from libtoolize: 'AC_PROG_RANLIB' is rendered obsolete by 'LT_INIT'. Signed-off-by: Antonin Décimo --- mingw-w64-libraries/winpthreads/configure| 104 +-- mingw-w64-libraries/winpthreads/configure.ac | 1 - 2 files changed, 1 insertion(+), 104 deletions(-)

[Mingw-w64-public] [PATCH 11/18] winpthreads: Prevent scoping issues and warnings in cleanup_push/pop

2023-11-29 Thread Antonin Décimo
Interestingly, pthread_cleanup_push/pop are allowed by POSIX to be implemented as macros opening and closing an lexical scope. By using the well-known trick of do { ... } while (0) [1], we prevent potential scoping issues in surrounding code when the macro is expanded. Removing the comma operator

[Mingw-w64-public] [PATCH 00/18] winpthreads: Patches and cleanups towards MSVC support

2023-11-29 Thread Antonin Décimo
Hello all, The OCaml language [1] version 5.0 [2] was released last year, switching to a multicore runtime. The previous version, 4.14, supported Cygwin, MinGW-w64, and MSVC on Windows. The current version now supports Cygwin and MinGW-w64, and we're working towards restoring MSVC support. The mu

[Mingw-w64-public] [PATCH 15/18] winpthreads: Add windres-rc, a wrapper for windres to rc

2023-11-29 Thread Antonin Décimo
Signed-off-by: Antonin Décimo --- .../winpthreads/build-aux/windres-rc | 158 ++ mingw-w64-libraries/winpthreads/configure | 13 +- mingw-w64-libraries/winpthreads/configure.ac | 8 +- .../winpthreads/src/version.rc| 18 +- 4 files changed, 185 in

[Mingw-w64-public] [PATCH 05/18] winpthreads: Use _strdup variant instead of strdup

2023-11-29 Thread Antonin Décimo
Microsoft considers these POSIX function names to be deprecated, and provides alternative names starting with an underscore. A deprecation warning is raised if the old names are used, which can alternatively be disabled with the _CRT_NONSTDC_NO_WARNINGS macro. https://learn.microsoft.com/en-us/cpp

[Mingw-w64-public] [PATCH 02/18] winpthreads: Move likely/unlikely to misc.h, noop under MSVC

2023-11-29 Thread Antonin Décimo
clang-cl defines both _MSC_VER and __clang__ and has support for the likely/unlikely builtins. Signed-off-by: Antonin Décimo --- mingw-w64-libraries/winpthreads/src/misc.h | 8 mingw-w64-libraries/winpthreads/src/mutex.c| 3 --- mingw-w64-libraries/winpthreads/src/spinlock.c | 3

[Mingw-w64-public] [PATCH 13/18] winpthreads: Small cleanups for clang

2023-11-29 Thread Antonin Décimo
- remove superflous semicolons; - avoid dead code warnings; - avoid function redeclaration with an added 'dllexport' attribute. Signed-off-by: Antonin Décimo --- mingw-w64-libraries/winpthreads/src/sem.c| 4 ++-- mingw-w64-libraries/winpthreads/src/thread.c | 5 +++-- mingw-w64-libraries/win

[Mingw-w64-public] [PATCH 18/18] winpthreads: Fix strict prototypes warnings

2023-11-29 Thread Antonin Décimo
Signed-off-by: Antonin Décimo --- mingw-w64-libraries/winpthreads/src/clock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mingw-w64-libraries/winpthreads/src/clock.c b/mingw-w64-libraries/winpthreads/src/clock.c index 322b7e5c4..db8b34ea5 100644 --- a/mingw-w64-librar

[Mingw-w64-public] [PATCH 16/18] winpthreads: Fix __WINPTHREAD_ENABLE_WRAP_API typo

2023-11-29 Thread Antonin Décimo
Retain the old name for backwards compatibility. Signed-off-by: Antonin Décimo --- mingw-w64-libraries/winpthreads/include/pthread.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mingw-w64-libraries/winpthreads/include/pthread.h b/mingw-w64-libraries/winpthreads/include/

[Mingw-w64-public] [PATCH 07/18] winpthreads: Fix TLS thread callback initializers on MSVC x64

2023-11-29 Thread Antonin Décimo
Signed-off-by: Antonin Décimo --- mingw-w64-libraries/winpthreads/src/thread.c | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/mingw-w64-libraries/winpthreads/src/thread.c b/mingw-w64-libraries/winpthreads/src/thread.c index 7c5e75f91..16b13b07c 100644 ---

[Mingw-w64-public] [PATCH 12/18] winpthreads: Fix include style

2023-11-29 Thread Antonin Décimo
MSVC warns against relative path in include directives. warning C4464: relative include path contains '..' https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4464?view=msvc-170 Signed-off-by: Antonin Décimo --- mingw-w64-libraries/winpthreads/src/bar

[Mingw-w64-public] [PATCH 01/18] winpthreads: Ignore MSVC object files

2023-11-29 Thread Antonin Décimo
Signed-off-by: Antonin Décimo --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 4cd47565a..f3d002a33 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,8 @@ *.lo *.la *.gch +*.obj +*.res # Specialized files autom4te.cache -- 2.43.0 __

[Mingw-w64-public] [PATCH 08/18] winpthreads: Use __assume(0) MSVC builtin for unreachable code

2023-11-29 Thread Antonin Décimo
https://learn.microsoft.com/en-us/cpp/intrinsics/assume?view=msvc-170 Signed-off-by: Antonin Décimo --- mingw-w64-libraries/winpthreads/src/mutex.c | 4 1 file changed, 4 insertions(+) diff --git a/mingw-w64-libraries/winpthreads/src/mutex.c b/mingw-w64-libraries/winpthreads/src/mutex.c i

[Mingw-w64-public] [PATCH 10/18] winpthreads: Protect macros with do { ... } while (0) idiom

2023-11-29 Thread Antonin Décimo
A classic idiom preventing all kinds of bad interactions with surrounding code when the macro is expanded. Newer compilers may also warn against empty statements of the form { expressions... }; where the ending ; is actually an empty statement. https://gcc.gnu.org/onlinedocs/cpp/Swallowing-t

[Mingw-w64-public] [PATCH 17/18] winpthreads: Don't assign within a conditional expression

2023-11-29 Thread Antonin Décimo
This idiom raises an annoying MSVC warning, C4706. https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4706?view=msvc-170 Signed-off-by: Antonin Décimo --- mingw-w64-libraries/winpthreads/src/barrier.c | 6 +++--- mingw-w64-libraries/winpthreads/src/

[Mingw-w64-public] [PATCH 06/18] winpthreads: PIMAGE_TLS_CALLBACK returns void, not BOOL

2023-11-29 Thread Antonin Décimo
https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#tls-callback-functions Signed-off-by: Antonin Décimo --- mingw-w64-libraries/winpthreads/src/thread.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mingw-w64-libraries/winpthreads/src/thread.c b/mingw-w

[Mingw-w64-public] [PATCH 04/18] winpthreads: Format error string with snprintf

2023-11-29 Thread Antonin Décimo
Previous code was too complex and hard to understand, and snprintf fits the job nicely. Signed-off-by: Antonin Décimo --- mingw-w64-libraries/winpthreads/src/thread.c | 21 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/mingw-w64-libraries/winpthreads/src/thr

[Mingw-w64-public] [PATCH 03/18] winpthreads: Inline INIT_RWLOCK into its only callsite

2023-11-29 Thread Antonin Décimo
Prevents a warning of `r` being shadowed, and makes the code clearer. Signed-off-by: Antonin Décimo --- mingw-w64-libraries/winpthreads/src/rwlock.c | 6 +- mingw-w64-libraries/winpthreads/src/rwlock.h | 3 --- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mingw-w64-librarie