Fix configure build with MinGW 5.3.0

Provide our own wcsnlen() declaration as the function is detected by configure
but is not declared in MinGW headers.

Closes #17762.
This commit is contained in:
Vadim Zeitlin
2017-01-14 00:07:44 +01:00
parent 7c22e4257b
commit 22406c7d86

View File

@@ -221,6 +221,13 @@ extern unsigned long android_wcstoul(const wchar_t *nptr, wchar_t **endptr, int
#endif
#ifdef HAVE_WCSNLEN
/*
When using MinGW, wcsnlen() is not declared, but is still found by
configure -- just declare it in this case as it seems better to use it
if it's available (see https://sourceforge.net/p/mingw/bugs/2332/)
*/
wxDECL_FOR_MINGW32_ALWAYS(size_t, wcsnlen, (const wchar_t*, size_t))
#define wxCRT_StrnlenW wcsnlen
#endif