Re: [Mingw-w64-public] [PATCH] crt: msvcrt.def.in: Fix _swprintf/_vswprintf symbol aliases

2024-04-09 Thread Pali Rohár
On Tuesday 09 April 2024 22:24:06 LIU Hao wrote:
> A little suggestion: If I was to import these functions, I would not add
> `swprintf` due to the inconsistency. For example, MSVCR120.DLL does not
> export `swprintf`, but only `_swprintf` and two C++ overloads; C++ names are
> mangled so they can never match each other. Maybe it's possible to add
> `swprintf` as an alias to the C99 one..?

Yesterday, I was thinking about it and has similar idea. Export
"swprintf" symbol to be C99-compatible and export "_swprintf" symbol to
be MSVC-compatible (without maxlen). It should be possible but it is
needed to also update header files and ensure that they would never emit
"swprintf" symbol for MSVC compatibility.

But before that I'm planning to look at cleaning up of symbol aliases.


___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH] crt: msvcrt.def.in: Fix _swprintf/_vswprintf symbol aliases

2024-04-09 Thread LIU Hao

在 2024-04-09 02:02, Pali Rohár 写道:

Symbols _swprintf and _vswprintf were added in Windows Vista and have same
meaning as symbols without leading underscore in msvcrt.dll. These symbols
(both with and without leading underscore) differs from C99 variant as they
do not take maxlen parameter.

For compatibility with pre-Vista systems, which are x86-only, define
_swprintf and _vswprintf symbols on I386 and X64 as aliases to swprintf and
vswprintf.
---
  mingw-w64-crt/lib-common/msvcrt.def.in | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)


This change looks good to me, so I pushed this.

A little suggestion: If I was to import these functions, I would not add `swprintf` due to the 
inconsistency. For example, MSVCR120.DLL does not export `swprintf`, but only `_swprintf` and two 
C++ overloads; C++ names are mangled so they can never match each other. Maybe it's possible to add 
`swprintf` as an alias to the C99 one..?



--
Best regards,
LIU Hao



OpenPGP_signature.asc
Description: OpenPGP digital signature
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH] add PATHCCH_ENSURE_IS_EXTENDED_LENGTH_PATH to pathcch.h

2024-04-09 Thread LIU Hao

在 2024-04-09 02:04, Oleg Tolmatcev 写道:

Would the attached patch look good to you?


Yes it looks good. Thank you.


Thanks for the feedback. Pushed now.

--
Best regards,
LIU Hao



OpenPGP_signature.asc
Description: OpenPGP digital signature
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public