From: Michael Wetherell Date: Fri, 22 Apr 2005 15:12:46 +0000 (+0000) Subject: Fixes to allow compilation with no wchar_t (djgpp probably has a real wchar_t X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/61c213fe224da24ce33c9187263e75a17ca83a04?ds=inline Fixes to allow compilation with no wchar_t (djgpp probably has a real wchar_t now, I will check, but compilation should work without anyway). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33834 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/configure.in b/configure.in index 4c521d332d..e7bdca44c6 100644 --- a/configure.in +++ b/configure.in @@ -1813,6 +1813,11 @@ AC_CHECK_SIZEOF(wchar_t, 0, #include ] ) +if test "$ac_cv_sizeof_wchar_t" != "0"; then + wxUSE_WCHAR_T=yes +else + wxUSE_WCHAR_T=no +fi dnl checks needed to define wxVaCopy AC_CACHE_CHECK([for va_copy], @@ -2447,6 +2452,17 @@ dnl ------------------------------------------------------------------------ dnl Check for expat libraries dnl ------------------------------------------------------------------------ +if test "$wxUSE_WCHAR_T" != "yes"; then + if test "$wxUSE_EXPAT" != "no"; then + AC_MSG_WARN([wxWidgets requires wchar_t to use expat, disabling]) + wxUSE_EXPAT=no + fi + if test "$wxUSE_XML" != "no"; then + AC_MSG_WARN([wxWidgets requires wchar_t to use xml, disabling]) + wxUSE_XML=no + fi +fi + if test "$wxUSE_EXPAT" != "no"; then wxUSE_XML=yes AC_DEFINE(wxUSE_EXPAT) @@ -3764,7 +3780,7 @@ dnl Check for functions dnl --------------------------------------------------------------------------- dnl don't check for wchar_t functions if we haven't got wchar_t itself -if test "$ac_cv_sizeof_wchar_t" != "0"; then +if test "$wxUSE_WCHAR_T" = "yes"; then AC_DEFINE(wxUSE_WCHAR_T) dnl check for wcslen in all possible places diff --git a/include/wx/sstream.h b/include/wx/sstream.h index b264c67021..02f878681b 100644 --- a/include/wx/sstream.h +++ b/include/wx/sstream.h @@ -83,8 +83,12 @@ private: // position in the stream in bytes, *not* in chars size_t m_pos; +#if wxUSE_WCHAR_T // string encoding converter (UTF8 is the standard) wxMBConvUTF8 m_conv; +#else + wxMBConv m_conv; +#endif DECLARE_NO_COPY_CLASS(wxStringOutputStream) }; diff --git a/src/html/m_layout.cpp b/src/html/m_layout.cpp index 2477eb76c6..879f95a761 100644 --- a/src/html/m_layout.cpp +++ b/src/html/m_layout.cpp @@ -300,7 +300,7 @@ TAG_HANDLER_BEGIN(TITLE, "TITLE") wxString title = m_WParser->GetSource()->Mid( tag.GetBeginPos(), tag.GetEndPos1()-tag.GetBeginPos()); -#if !wxUSE_UNICODE +#if !wxUSE_UNICODE && wxUSE_WCHAR_T wxCSConv conv(m_WParser->GetInputEncoding()); title = wxString(title.wc_str(conv), wxConvLocal); #endif