don't use mbstowcs(NULL) with Cygwin (closes #10526)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@59208 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-02-28 19:34:30 +00:00
parent 2175a98d7c
commit 59214a529e

View File

@@ -133,9 +133,10 @@ wxBasicString::wxBasicString(const wxString& str)
// Takes an ANSI string and transforms it to Unicode
void wxBasicString::Init(const char *sz)
{
// get the size of required buffer
// get the size of required buffer: MetroWerks and Cygwin crash if NULL is
// passed to mbstowcs()
UINT lenAnsi = strlen(sz);
#ifdef __MWERKS__
#if defined(__MWERKS__) || defined(__CYGWIN__)
UINT lenWide = lenAnsi * 2 ;
#else
UINT lenWide = mbstowcs(NULL, sz, lenAnsi);