Re: [Mingw-w64-public] [PATCH 2/2] crt: Replace some IDs with header files in strmiids library

2023-12-14 Thread Biswapriyo Nath
Apologies for the oversight, but it is necessary to import qedit.idl from wine for this change. ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

[Mingw-w64-public] [PATCH 2/2] crt: Replace some IDs with header files in strmiids library

2023-12-14 Thread Biswapriyo Nath
From f2718f6525e1fef2333846921c4aebdf75414bfb Mon Sep 17 00:00:00 2001 From: Biswapriyo Nath Date: Fri, 15 Dec 2023 03:38:58 + Subject: [PATCH 2/2] crt: Replace some IDs with header files in strmiids library Signed-off-by: Biswapriyo Nath --- mingw-w64-crt/libsrc/strmiids.c | 123 +++--

[Mingw-w64-public] [PATCH 1/2] crt: Include qedit.h in amstrmid library

2023-12-14 Thread Biswapriyo Nath
From 4ef71dfdcd78dd923132411c1564e3d1db8c1bd4 Mon Sep 17 00:00:00 2001 From: Biswapriyo Nath Date: Fri, 15 Dec 2023 03:36:59 + Subject: [PATCH 1/2] crt: Include qedit.h in amstrmid library Signed-off-by: Biswapriyo Nath --- mingw-w64-crt/libsrc/amstrmid.c | 1 + 1 file changed, 1 insertion

[Mingw-w64-public] [PATCH v3 16/22] winpthreads: Separate MSVC and MinGW specific flags and targets

2023-12-14 Thread Antonin Décimo
- don't pass -D__USE_MINGW_ANSI_STDIO=0 to MSVC; - don't build libgcc/fakelib with MSVC. Signed-off-by: Antonin Décimo --- mingw-w64-libraries/winpthreads/Makefile.am | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mingw-w64-libraries/winpthreads/Makefile.am b/mi

[Mingw-w64-public] [PATCH v3 21/22] winpthreads: Test explicitly the result of an assign in a condition

2023-12-14 Thread Antonin Décimo
This particular snippet raises an annoying MSVC warning, C4706. We apply the suggested workaround. > If you intend to make your test value the result of an assignment, > test to ensure that the assignment is non-zero or not null. https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warni

[Mingw-w64-public] [PATCH v3 18/22] winpthreads: Regenerate autotools scripts with automake 1.16.5

2023-12-14 Thread Antonin Décimo
This is done by running `WANT_AUTOMAKE=1.16 autoreconf -ifv` in the winpthreads directory. Signed-off-by: Antonin Décimo --- mingw-w64-libraries/winpthreads/Makefile.in | 37 +++--- mingw-w64-libraries/winpthreads/configure | 131 2 files changed, 48 insertions(+), 120 de

[Mingw-w64-public] [PATCH v3 20/22] winpthreads: Fix __WINPTHREAD_ENABLE_WRAP_API typo

2023-12-14 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 v3 19/22] winpthreads: Update version.rc and support RC

2023-12-14 Thread Antonin Décimo
Binutils' windres uses the C preprocessor and gets MinGW pre-defined macros, whereas the Microsoft tool RC [1] implements its own C preprocessor and doesn't call MSVC, so it defines a subset of the macros. Also update the copyright year, license field, and url of the project. License field is upd

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

2023-12-14 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 v3 12/22] winpthreads: Small cleanups for clang

2023-12-14 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 v3 15/22] winpthreads: Silence MSVC copyright message

2023-12-14 Thread Antonin Décimo
Signed-off-by: Antonin Décimo --- mingw-w64-libraries/winpthreads/Makefile.am | 4 mingw-w64-libraries/winpthreads/configure.ac | 5 - 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/mingw-w64-libraries/winpthreads/Makefile.am b/mingw-w64-libraries/winpthreads/Makefile.am

[Mingw-w64-public] [PATCH v3 13/22] winpthreads: AC_PROG_RANLIB is obsoleted by LT_INIT

2023-12-14 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.ac | 1 - 1 file changed, 1 deletion(-) diff --git a/mingw-w64-libraries/winpthreads/configure.ac b/mingw-w64-libraries/winpthreads/c

[Mingw-w64-public] [PATCH v3 07/22] winpthreads: Fix thread-local storage callbacks on MSVC

2023-12-14 Thread Antonin Décimo
- Force a reference to _tls_used to make the linker create the TLS directory if it's not already there. (e.g. if __declspec(thread) is not used). - Force a reference to __xl_f to prevent whole program optimization from discarding the variable. - On x86, symbols are prefixed with an underscor

[Mingw-w64-public] [PATCH v3 04/22] winpthreads: Inline INIT_RWLOCK into its only callsite

2023-12-14 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

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

2023-12-14 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/misc.h | 6 ++ mingw-w64-libraries/winpthreads/src/mutex.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/mingw-w64-libraries/wi

[Mingw-w64-public] [PATCH v3 14/22] winpthreads: Add windres-rc, a wrapper for windres to rc

2023-12-14 Thread Antonin Décimo
Signed-off-by: Antonin Décimo --- .../winpthreads/build-aux/windres-rc | 158 ++ mingw-w64-libraries/winpthreads/configure.ac | 7 +- 2 files changed, 163 insertions(+), 2 deletions(-) create mode 100755 mingw-w64-libraries/winpthreads/build-aux/windres-rc diff --git

[Mingw-w64-public] [PATCH v3 11/22] winpthreads: Fix include style

2023-12-14 Thread Antonin Décimo
MSVC warns [1] against relative path in include directives, and semaphore.h is already in the include path. warning C4464: relative include path contains '..' [1]: https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4464?view=msvc-170 windows.h i

[Mingw-w64-public] [PATCH v3 17/22] winpthreads: Disable warnings for POSIX function names

2023-12-14 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 be disabled with the _CRT_NONSTDC_NO_WARNINGS macro. https://learn.microsoft.com/en-us/cpp/error-message

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

2023-12-14 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 v3 10/22] winpthreads: Prevent scoping issues and warnings in cleanup_push/pop

2023-12-14 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 v3 08/22] winpthreads: Fix printf format specifiers

2023-12-14 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 v3 00/22] winpthreads: Patches and cleanups towards MSVC support

2023-12-14 Thread Antonin Décimo
Hi all, This v3 patch series is updated with all suggestions from the v2, with the notable additions that I've changed the winpthreads autoconf script not to build libgcc or fakelib if MSVC is used. The new license string "MIT AND BSD-3-Clause" in the version.rc file now reflects the COPYING file

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

2023-12-14 Thread Antonin Décimo
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 --- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/mingw-w64-libraries/winpthr

[Mingw-w64-public] [PATCH v3 05/22] winpthreads: Format error string with snprintf

2023-12-14 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 v3 01/22] winpthreads: Ignore MSVC object files and Autotools generated files

2023-12-14 Thread Antonin Décimo
Signed-off-by: Antonin Décimo --- .gitignore | 4 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 4cd47565a..3d1022348 100644 --- a/.gitignore +++ b/.gitignore @@ -12,13 +12,17 @@ *.lo *.la *.gch +*.obj +*.res # Specialized files autom4te.cache +config.cach

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

2023-12-14 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