Added --with-unicode (not used yet) and --with-wcsrtombs options

to configurea and setup.h.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@805 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1998-10-05 16:21:28 +00:00
parent 418955322b
commit fb4e5803ed
4 changed files with 421 additions and 279 deletions

View File

@@ -41,6 +41,10 @@
#include <string.h>
#include <stdlib.h>
#ifdef wxUSE_WCSRTOMBS
#include <wchar.h> // for wcsrtombs(), see comments where it's used
#endif // GNU
#ifdef WXSTRING_IS_WXOBJECT
IMPLEMENT_DYNAMIC_CLASS(wxString, wxObject)
#endif //WXSTRING_IS_WXOBJECT
@@ -216,7 +220,17 @@ wxString::wxString(const void *pStart, const void *pEnd)
wxString::wxString(const wchar_t *pwz)
{
// first get necessary size
// NB: GNU libc5 wcstombs() is completely broken, don't use it (it doesn't
// honor the 3rd parameter, thus it will happily crash here).
#ifdef wxUSE_WCSRTOMBS
// don't know if it's really needed (or if we can pass NULL), but better safe
// than quick
mbstate_t mbstate;
size_t nLen = wcsrtombs((char *) NULL, &pwz, 0, &mbstate);
#else // !GNU libc
size_t nLen = wcstombs((char *) NULL, pwz, 0);
#endif // GNU
// empty?
if ( nLen != 0 ) {