Re: [Mingw-w64-public] __MSVCRT_VERSION__ value for msvcrt.dll

2024-10-18 Thread LIU Hao
在 2024-10-19 04:36, Martin Storsjö 写道: But you're right that technically, msvcrt.dll is more of a 6.0 than a 7.0 msvcrt (although it has gotten many additions on top of the original one from MSVC 6.0). I guess we could use 0x6FF as well, to allow us to distinguish that we mean msvcrt.dll as ship

[Mingw-w64-public] [PATCH v2] crt: Fix building of libmsvcrtd.a import library

2024-10-18 Thread Pali Rohár
libmsvcrtd.a is import library for msvcrtd.dll and therefore it cannot include libmsvcrt_extra.a library which object files are compiled with -D__LIBMSVCRT_OS__ which instruct code to access msvcrt.dll library. Add a new static library libmsvcrtd_extra.a which is compiled from subset of libmsvcrt_

Re: [Mingw-w64-public] [PATCH] crt: Fix building of libmsvcrtd.a import library

2024-10-18 Thread Pali Rohár
On Saturday 19 October 2024 00:22:00 Martin Storsjö wrote: > On Fri, 11 Oct 2024, Pali Rohár wrote: > > > libmsvcrtd.a is import library for msvcrtd.dll and therefore it cannot > > include libmsvcrt_extra.a library which object files are compiled with > > -D__LIBMSVCRT_OS__ which instruct code to

Re: [Mingw-w64-public] __MSVCRT_VERSION__ value for msvcrt.dll

2024-10-18 Thread Pali Rohár
On Friday 18 October 2024 23:36:06 Martin Storsjö wrote: > On Fri, 18 Oct 2024, Pali Rohár wrote: > > > Hello, in recent commit 797b4a6b5191 ("headers: Expose the wchar ctype > > _l functions for msvcrt.dll for Vista") was added following pattern: > > > >#if __MSVCRT_VERSION__ >= 0x800 || (__

Re: [Mingw-w64-public] __MSVCRT_VERSION__ value for msvcrt.dll

2024-10-18 Thread Martin Storsjö
On Fri, 18 Oct 2024, Pali Rohár wrote: Hello, in recent commit 797b4a6b5191 ("headers: Expose the wchar ctype _l functions for msvcrt.dll for Vista") was added following pattern: #if __MSVCRT_VERSION__ >= 0x800 || (__MSVCRT_VERSION__ == 0x700 && _WIN32_WINNT >= 0x0600) /* These are ava

Re: [Mingw-w64-public] [PATCH] crt: Fix building of libmsvcrtd.a import library

2024-10-18 Thread Martin Storsjö
On Fri, 11 Oct 2024, Pali Rohár wrote: libmsvcrtd.a is import library for msvcrtd.dll and therefore it cannot include libmsvcrt_extra.a library which object files are compiled with -D__LIBMSVCRT_OS__ which instruct code to access msvcrt.dll library. Add a new static library libmsvcrtd_extra.a w

Re: [Mingw-w64-public] [PATCH] winpthreads: also use SetThreadDescription to set thread name

2024-10-18 Thread Martin Storsjö
On Thu, 17 Oct 2024, Antonin Décimo wrote: There are two ways to set a thread name. The first is via the SetThreadDescription function. The second is by throwing a particular exception while the Visual Studio debugger is attached to the process. Each approach has benefits and caveats. The use of

Re: [Mingw-w64-public] __MSVCRT_VERSION__ value for msvcrt.dll

2024-10-18 Thread Martin Storsjö
On Fri, 18 Oct 2024, Pali Rohár wrote: Liu Hao presented another option in the discussion as well - we could also define __MSVCRT_VERSION__ to another value inbetween, as it currently is 0x700 for msvcr70.dll, we could set it to 0x7FF, so that existing comparisons with <= and >= behave mostly th

Re: [Mingw-w64-public] [PATCH v2 2/2] headers: Remove invalid arithmetic intsafe.h macros assuming 64-bit pointer size.

2024-10-18 Thread Jacek Caban
On 18.10.2024 18:09, David Grayson wrote: Indeed there are still numerous bugs in intsafe.h reported by my test suite, even after applying the patch. For example, SSIZETToLong is needlessly redefined, resulting in it having the incorrect type for its first argument (LONGLONG instead of SSIZE_T).

[Mingw-w64-public] __MSVCRT_VERSION__ value for msvcrt.dll

2024-10-18 Thread Pali Rohár
Hello, in recent commit 797b4a6b5191 ("headers: Expose the wchar ctype _l functions for msvcrt.dll for Vista") was added following pattern: #if __MSVCRT_VERSION__ >= 0x800 || (__MSVCRT_VERSION__ == 0x700 && _WIN32_WINNT >= 0x0600) /* These are available since msvcr80.dll, and in msvcrt.

Re: [Mingw-w64-public] [PATCH v2 2/2] headers: Remove invalid arithmetic intsafe.h macros assuming 64-bit pointer size.

2024-10-18 Thread David Grayson
Indeed there are still numerous bugs in intsafe.h reported by my test suite, even after applying the patch. For example, SSIZETToLong is needlessly redefined, resulting in it having the incorrect type for its first argument (LONGLONG instead of SSIZE_T). My tests are here: https://github.com/Davi

Re: [Mingw-w64-public] [PATCH v2 2/2] headers: Remove invalid arithmetic intsafe.h macros assuming 64-bit pointer size.

2024-10-18 Thread Martin Storsjö
On Fri, 18 Oct 2024, Jacek Caban wrote: We have inline versions that do the right thing in all cases. Fixes: 0cf06d5cb6968ad71d36a193eeb04f3266bb3aaa Signed-off-by: Jacek Caban --- mingw-w64-headers/include/intsafe.h | 26 +- 1 file changed, 1 insertion(+), 25 deletions

Re: [Mingw-w64-public] [PATCH] headers: Fix intsafe.h arithmetic macros on 32-bit targets.

2024-10-18 Thread Jacek Caban
On 18.10.2024 13:59, David Grayson wrote: Hey, original contributor of intsafe.h here. Thank you for fixing this bug, which was introduced in 2019 by someone else. I agree with Martin: let's keep the header short and readable, avoid unneeded ifdefs, define functions in a way that they are obvio

[Mingw-w64-public] [PATCH v2 2/2] headers: Remove invalid arithmetic intsafe.h macros assuming 64-bit pointer size.

2024-10-18 Thread Jacek Caban
We have inline versions that do the right thing in all cases. Fixes: 0cf06d5cb6968ad71d36a193eeb04f3266bb3aaa Signed-off-by: Jacek Caban --- mingw-w64-headers/include/intsafe.h | 26 +- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/mingw-w64-headers/incl

[Mingw-w64-public] [PATCH v2 1/2] headers: Add missing SIZE_T intsafe.h helpers.

2024-10-18 Thread Jacek Caban
Signed-off-by: Jacek Caban --- mingw-w64-headers/include/intsafe.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mingw-w64-headers/include/intsafe.h b/mingw-w64-headers/include/intsafe.h index d05ecf864..859dbdafc 100644 --- a/mingw-w64-headers/include/intsafe.h +++ b/mingw-w64-headers

Re: [Mingw-w64-public] [PATCH] headers: Fix intsafe.h arithmetic macros on 32-bit targets.

2024-10-18 Thread David Grayson
Hey, original contributor of intsafe.h here. Thank you for fixing this bug, which was introduced in 2019 by someone else. I agree with Martin: let's keep the header short and readable, avoid unneeded ifdefs, define functions in a way that they are obviously correct on all systems, and not define

Re: [Mingw-w64-public] [PATCH] headers: Fix intsafe.h arithmetic macros on 32-bit targets.

2024-10-18 Thread Martin Storsjö
On Fri, 18 Oct 2024, Jacek Caban wrote: Don't assume that pointer-sized types are long long. Fixes: 0cf06d5cb6968ad71d36a193eeb04f3266bb3aaa Signed-off-by: Jacek Caban --- mingw-w64-headers/include/intsafe.h | 160 +++- 1 file changed, 85 insertions(+), 75 deletions(-)

[Mingw-w64-public] [PATCH] headers: Fix intsafe.h arithmetic macros on 32-bit targets.

2024-10-18 Thread Jacek Caban
Don't assume that pointer-sized types are long long. Fixes: 0cf06d5cb6968ad71d36a193eeb04f3266bb3aaa Signed-off-by: Jacek Caban --- mingw-w64-headers/include/intsafe.h | 160 +++- 1 file changed, 85 insertions(+), 75 deletions(-) diff --git a/mingw-w64-headers/include/