Re: [Mingw-w64-public] [PATCH] headers: Move some macros about deprecated functions from 'strsafe.h' into 'dontuse.h'

2024-02-28 Thread LIU Hao
在 2024-02-29 01:14, Martin Storsjö 写道: It would be much more understandable, if the message would start with some context like this: ---8<--- WinSDK's strsafe.h also tries to discourage users from calling a bunch of its internal functions. This is done in two different ways; if

Re: [Mingw-w64-public] [PATCH] crt: Fix comments in msvcrt-common.def.in

2024-02-28 Thread Pali Rohár
On Wednesday 28 February 2024 23:24:25 Martin Storsjö wrote: > On Wed, 28 Feb 2024, Pali Rohár wrote: > > > All commented lines refers to non-underscore aliases for underscored > > variant of functions. Aliases for some reasons are not prevent, e.g. > > because some aliases are defined in other

Re: [Mingw-w64-public] [PATCH] crt: Define 32-bit time function aliases for all CRT libraries

2024-02-28 Thread Martin Storsjö
On Wed, 28 Feb 2024, Pali Rohár wrote: Header file time.h already redirects function call gmtime() to _gmtime32(). So if object file compiled with time.h is linked with e.g. libmsvcrt40.a import library then it is needed to add redirection from _gmtime32 symbol to gmtime symbol into

Re: [Mingw-w64-public] [PATCH] crt: Fix comments in msvcrt-common.def.in

2024-02-28 Thread Martin Storsjö
On Wed, 28 Feb 2024, Pali Rohár wrote: All commented lines refers to non-underscore aliases for underscored variant of functions. Aliases for some reasons are not prevent, e.g. because some aliases are defined in other files (CRT_fp10.c and CRT_fp8.c). I don't understand what the second

Re: [Mingw-w64-public] [PATCH] crt: Update crtdll.def.in

2024-02-28 Thread Martin Storsjö
On Wed, 28 Feb 2024, Pali Rohár wrote: * Include C++ mangled symbols * Include Windows NT 3.51+ symbols * Extend comment about different versions * Update list of symbols which do not have prototypes yet --- mingw-w64-crt/lib32/crtdll.def.in | 152 ++ 1 file changed,

Re: [Mingw-w64-public] [PATCH] crt: Add link to CRT startup GNU LD bug

2024-02-28 Thread Martin Storsjö
On Wed, 28 Feb 2024, Pali Rohár wrote: --- mingw-w64-crt/crt/crtdll.c | 2 +- mingw-w64-crt/crt/crtexe.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mingw-w64-crt/crt/crtdll.c b/mingw-w64-crt/crt/crtdll.c index 0f08a1a50d78..88450ce9f74f 100644 ---

Re: [Mingw-w64-public] [PATCH 1/2] crt: Do not export DllEntryPoint from def files

2024-02-28 Thread Martin Storsjö
On Wed, 28 Feb 2024, Pali Rohár wrote: If application does not specify its own DllEntryPoint function then the default DllEntryPoint provided by libmingwex library should be used. And not from some random system DLL library. --- mingw-w64-crt/lib64/fxsdrv.def | 1 -

Re: [Mingw-w64-public] [PATCH 1/3] crt: Add non-inline variant of UCRT _scprintf, _snprintf and _snscanf functions

2024-02-28 Thread Pali Rohár
On Tuesday 09 May 2023 22:29:31 LIU Hao wrote: > Our conclusion is that, in order to reduce possible UCRT dependency, moving > inline definitions out of headers makes sense; but the other part, such as > duplication of functions, will not be accepted. Ok, so does it mean that the one change with

[Mingw-w64-public] [PATCH] crt: Define 32-bit time function aliases for all CRT libraries

2024-02-28 Thread Pali Rohár
Header file time.h already redirects function call gmtime() to _gmtime32(). So if object file compiled with time.h is linked with e.g. libmsvcrt40.a import library then it is needed to add redirection from _gmtime32 symbol to gmtime symbol into libmsvcrt40.a library to ensure that application

[Mingw-w64-public] [PATCH] crt: Fix comments in msvcrt-common.def.in

2024-02-28 Thread Pali Rohár
All commented lines refers to non-underscore aliases for underscored variant of functions. Aliases for some reasons are not prevent, e.g. because some aliases are defined in other files (CRT_fp10.c and CRT_fp8.c). --- mingw-w64-crt/def-include/msvcrt-common.def.in | 15 --- 1 file

[Mingw-w64-public] [PATCH] crt: Update crtdll.def.in

2024-02-28 Thread Pali Rohár
* Include C++ mangled symbols * Include Windows NT 3.51+ symbols * Extend comment about different versions * Update list of symbols which do not have prototypes yet --- mingw-w64-crt/lib32/crtdll.def.in | 152 ++ 1 file changed, 29 insertions(+), 123 deletions(-) diff

[Mingw-w64-public] [PATCH] crt: Add link to CRT startup GNU LD bug

2024-02-28 Thread Pali Rohár
--- mingw-w64-crt/crt/crtdll.c | 2 +- mingw-w64-crt/crt/crtexe.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mingw-w64-crt/crt/crtdll.c b/mingw-w64-crt/crt/crtdll.c index 0f08a1a50d78..88450ce9f74f 100644 --- a/mingw-w64-crt/crt/crtdll.c +++

[Mingw-w64-public] [PATCH 1/2] crt: Do not export DllEntryPoint from def files

2024-02-28 Thread Pali Rohár
If application does not specify its own DllEntryPoint function then the default DllEntryPoint provided by libmingwex library should be used. And not from some random system DLL library. --- mingw-w64-crt/lib64/fxsdrv.def | 1 - mingw-w64-crt/lib64/wiaservc.def | 1 - 2 files changed, 2

[Mingw-w64-public] [PATCH 2/2] crt: Do not export DllMain from def files

2024-02-28 Thread Pali Rohár
Trying to use or link DllMain symbol from some random system DLL library is in most cases a mistake. So hide all DllMain definitions from all def files. --- mingw-w64-crt/lib-common/acledit.def | 1 - mingw-w64-crt/lib-common/htui.def | 1 - mingw-w64-crt/lib-common/keymgr.def | 1 -

Re: [Mingw-w64-public] [PATCH] headers: Move some macros about deprecated functions from 'strsafe.h' into 'dontuse.h'

2024-02-28 Thread Martin Storsjö
On Wed, 28 Feb 2024, LIU Hao wrote: Attached is the updated patch. Ok, so let's see... because the semicolon in the macro `lstrcpyA` affects not only invocations, but also declarations. Those semicolons have been removed since Windows SDK 8.0, so we remove them as well. This allows

Re: [Mingw-w64-public] [PATCH] headers: Move some macros about deprecated functions from 'strsafe.h' into 'dontuse.h'

2024-02-28 Thread LIU Hao
在 2024-02-28 06:01, Martin Storsjö 写道: Can you mention in the commit message, what used to break if strsafe.h was included befoe windows.h? The commit message explains that we're moveing a bunch of macros from strsafe.h into dontuse.h, but in the diff, I'm also seeing a bunch of other minor

Re: [Mingw-w64-public] [PATCH] include/tchar: Add more macros

2024-02-28 Thread LIU Hao
在 2024-02-28 06:04, Martin Storsjö 写道: On Mon, 26 Feb 2024, LIU Hao wrote: This should match latest Windows SDK except for `strtold_l()` and `wcstold_l()`. The Microsoft implementations produce 64-bit numbers that do not match the GNU ABI, and we at the moment do not have locale-aware