fix compilation with mingw32

This commit is contained in:
Andrzej Rybczak
2010-05-14 18:05:14 +02:00
parent 6eae6cd0f6
commit 9adb762036
2 changed files with 8 additions and 0 deletions

View File

@@ -940,7 +940,11 @@ std::wstring ToWString(const std::string &s)
size_t Window::Length(const std::wstring &ws)
{
# ifdef WIN32
return ws.length();
# else
int len = wcswidth(ws.c_str(), -1);
return len < 0 ? ws.length() : len;
# endif // WIN32
}