]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixes to allow compilation with no wchar_t (djgpp probably has a real wchar_t
authorMichael Wetherell <mike.wetherell@ntlworld.com>
Fri, 22 Apr 2005 15:12:46 +0000 (15:12 +0000)
committerMichael Wetherell <mike.wetherell@ntlworld.com>
Fri, 22 Apr 2005 15:12:46 +0000 (15:12 +0000)
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

configure.in
include/wx/sstream.h
src/html/m_layout.cpp

index 4c521d332d3b7d7d8b99ce919dd5fd5946dc644e..e7bdca44c677d07c3a4cddf46cb11315a8895fb1 100644 (file)
@@ -1813,6 +1813,11 @@ AC_CHECK_SIZEOF(wchar_t, 0,
         #include <stdio.h>
     ]
 )
+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
index b264c670216d9704968cd05bf9f31fcd619b6310..02f878681b10fd71ae52e66220397fca4c1365e0 100644 (file)
@@ -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)
 };
index 2477eb76c67288ee1ee52e090be27b604da76147..879f95a761418c422707ecb1dae9362db567e682 100644 (file)
@@ -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