-----BEGIN PGP SIGNED MESSAGE-----
On 9/30/2010 09:43, Dongsheng Song wrote:
> On 2010-9-29 22:33, Kai Tietz wrote:
>>>>> On Wed, Sep 29, 2010 at 5:56 PM, JonY <jon_y@...> wrote:
>>>>>> As far as I know, this is not a bug. That comment means that it is
>>>>>> available with Windows 7.
>>>>>> Until its reimplemented in libmingwex, the proper fix would be not to
>>>>>> call it if you expect your program to run on earlier versions of windows.
> No, this is not possible/acceptable. For example, the following code is very general:
> # if HAVE_WCSNLEN
> # define local_wcsnlen wcsnlen
> # else
> static size_t
> local_wcsnlen (const wchar_t *s, size_t maxlen)
> const wchar_t *ptr;
> for (ptr = s; maxlen > 0 && *ptr != (wchar_t) 0; ptr++, maxlen--)
> return ptr - s;
> # endif
Neither is your wcsnlen code acceptable, it does not verify if the
unicode sequences are valid.
> But since wcsnlen in both headers and libmsvrt.a, the autotools always
> report 'yes, your target platform have wcsnlen' !!!
Please check how the tests are run, it is unlikely the headers are
checked at all. Alternatively, you can check your config.status and edit
> If we do not want to drop these symbols not in windows XP, we should declare:
> mingw-64 maybe generate invalid dll/exe files on target platform older than windows 7.
> Because these files maybe reference symbols only valid on windows 7, please check your
> dll/exe files carefully after build.
That is because you are calling functions that do not exists on your
system, why would you expect it to work at all?
>> The only general solution for this would be that someone contributes
>> an implementation for this function. So we don't dependent here. The
>> only issue I see here is that this wcstrnlen possibly depends on
>> internal undocumented stuff. I'll do some research for this.
> Maybe there have another solution:
> S1: the intersection of XP and 2k3 symbols in msvcrt.dll
> S2: the intersection of VISTA and 2k8 symbols in msvcrt.dll
> S3: the Windows 7 symbols in msvcrt.dll
> libmsvcrt: S1
> libvista: (S2 - S1)
> libwin7: (S3 - S1) or (S3 - S2)
> If user want to use symbols in VISTA/2K8, they should put libvista in additional library list.
> Then the generated files only valid on vista/2k8 or later is acceptable for these users.
> If user want to use symbols in Windows 7, they should put libwin7 in additional library list.
> Then the generated files only valid on Windows 7 or later is acceptable for these users.
If you are willing to maintain it, then come and join #mingw-w64, we are
always short of maintainers.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (MingW32)
-----END PGP SIGNATURE-----