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.dll since Vista.
*/
_CRTIMP int __cdecl _iswalpha_l(wint_t _C,_locale_t _Locale);
...
#endif
In my opinion, this is wrong because __MSVCRT_VERSION__ == 0x700 matches
msvcr70.dll library and this library does not provide _iswalpha_l()
function on Windows Vista and neither on any other new versions.
I understand the point of the commit - to make those functions visible
when compiling against system msvcrt.dll library for Vista+ and at the
same time to hide these functions for pre-msvcr80 libraries and
pre-Vista msvcrt.dll.
It is quite ambiguous what "__MSVCRT_VERSION__ == 0x700" mean as it is
used for both msvcrt.dll and also msvcr70.dll. But msvcrt.dll and
msvcr70.dll provides different set of symbols.
I think that this can be fixed by one of the following options:
Option 1) Introduce a new define for compilation against system
msvcrt.dll library, e.g. -D__MSVCRT_VERSION_SYSTEM__ and write that
check as:
#if __MSVCRT_VERSION__ >= 0x800 || (defined(__MSVCRT_VERSION_SYSTEM__) &&
_WIN32_WINNT >= 0x0600)
/* These are available since msvcr80.dll, and in msvcrt.dll since Vista.
*/
_CRTIMP int __cdecl _iswalpha_l(wint_t _C,_locale_t _Locale);
...
#endif
Option 2) As system msvcrt.dll library has same name as library from
Visual C++ 4.2 - 6.0 versions and is backward compatible with them, so
change msvcrt-os version in file mingw-w64-headers/configure.ac from
0x700 to 0x600:
msvcrt*)
default_msvcrt_version=0x600
and then change check in header file as:
#if __MSVCRT_VERSION__ >= 0x800 || (__MSVCRT_VERSION__ == 0x600 &&
_WIN32_WINNT >= 0x0600)
/* These are available since msvcr80.dll, and in msvcrt.dll since Vista.
*/
_CRTIMP int __cdecl _iswalpha_l(wint_t _C,_locale_t _Locale);
...
#endif
This would mean:
* __MSVCRT_VERSION__ >= 0x800 - compiling for msvcr80.dll or new
* __MSVCRT_VERSION__ == 0x600 - compiling for msvcrt.dll
* _WIN32_WINNT >= 0x0600 - compiling for Vista or new
So (__MSVCRT_VERSION__ == 0x600 && _WIN32_WINNT >= 0x0600) would mean
that compiling for msvcrt.dll on Vista+.
What do you think?
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public