diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake index 576f8506e2..ab17223baf 100644 --- a/build/cmake/init.cmake +++ b/build/cmake/init.cmake @@ -194,9 +194,6 @@ endif() # Constants for setup.h creation set(wxUSE_STD_DEFAULT ON) -if(wxUSE_UNICODE) - set(wxUSE_WCHAR_T ON) -endif() if(NOT wxUSE_EXPAT) set(wxUSE_XRC OFF) endif() diff --git a/build/cmake/setup.h.in b/build/cmake/setup.h.in index 2ee13d6522..d8dae8ada1 100644 --- a/build/cmake/setup.h.in +++ b/build/cmake/setup.h.in @@ -182,8 +182,6 @@ #cmakedefine01 wxUSE_UNICODE #endif -#cmakedefine01 wxUSE_WCHAR_T - #cmakedefine01 wxUSE_EXCEPTIONS diff --git a/configure b/configure index 83cc27e66a..195d09867a 100755 --- a/configure +++ b/configure @@ -19573,8 +19573,6 @@ _ACEOF if test "$ac_cv_sizeof_wchar_t" = 0; then as_fn_error $? "wxWidgets requires wchar_t support." "$LINENO" 5 fi -$as_echo "#define wxUSE_WCHAR_T 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for va_copy" >&5 $as_echo_n "checking for va_copy... " >&6; } diff --git a/configure.in b/configure.in index 97e351c8f9..41f15e386b 100644 --- a/configure.in +++ b/configure.in @@ -1561,7 +1561,6 @@ AC_CHECK_SIZEOF(wchar_t, 0, if test "$ac_cv_sizeof_wchar_t" = 0; then AC_MSG_ERROR([wxWidgets requires wchar_t support.]) fi -AC_DEFINE(wxUSE_WCHAR_T) dnl checks needed to define wxVaCopy AC_CACHE_CHECK([for va_copy], diff --git a/include/wx/android/setup.h b/include/wx/android/setup.h index 0055c63e43..a1a344adae 100644 --- a/include/wx/android/setup.h +++ b/include/wx/android/setup.h @@ -183,7 +183,7 @@ // Unicode support // ---------------------------------------------------------------------------- -// These settings are obsolete: the library is always built in Unicode mode +// This option is deprecated: the library should be always built in Unicode mode // now, only set wxUSE_UNICODE to 0 to compile legacy code in ANSI mode if // absolutely necessary -- updating it is strongly recommended as the ANSI mode // will disappear completely in future wxWidgets releases. @@ -191,9 +191,6 @@ #define wxUSE_UNICODE 1 #endif -// wxUSE_WCHAR_T is required by wxWidgets now, don't change. -#define wxUSE_WCHAR_T 1 - // ---------------------------------------------------------------------------- // global features // ---------------------------------------------------------------------------- diff --git a/include/wx/chartype.h b/include/wx/chartype.h index 9a3a805a21..b29c1a6a0c 100644 --- a/include/wx/chartype.h +++ b/include/wx/chartype.h @@ -21,26 +21,9 @@ */ #include "wx/types.h" -/* check whether we have wchar_t and which size it is if we do */ -#if !defined(wxUSE_WCHAR_T) - #if defined(__UNIX__) - #if defined(HAVE_WCSTR_H) || defined(HAVE_WCHAR_H) || defined(__FreeBSD__) || defined(__DARWIN__) - #define wxUSE_WCHAR_T 1 - #else - #define wxUSE_WCHAR_T 0 - #endif - #elif defined(__GNUWIN32__) && !defined(__MINGW32__) - #define wxUSE_WCHAR_T 0 - #else - /* add additional compiler checks if this fails */ - #define wxUSE_WCHAR_T 1 - #endif -#endif /* !defined(wxUSE_WCHAR_T) */ - -/* Unicode support requires wchar_t */ -#if !wxUSE_WCHAR_T - #error "wchar_t must be available" -#endif /* Unicode */ +/* This is kept only for backwards compatibility, in case some application code + checks for it. It's always 1 and can't be changed. */ +#define wxUSE_WCHAR_T 1 /* non Unix compilers which do have wchar.h (but not tchar.h which is included @@ -123,11 +106,6 @@ #ifdef wxHAVE_TCHAR_SUPPORT /* get TCHAR definition if we've got it */ #include - - /* we surely do have wchar_t if we have TCHAR */ - #ifndef wxUSE_WCHAR_T - #define wxUSE_WCHAR_T 1 - #endif /* !defined(wxUSE_WCHAR_T) */ #endif /* wxHAVE_TCHAR_SUPPORT */ /* ------------------------------------------------------------------------- */ diff --git a/include/wx/gtk/setup0.h b/include/wx/gtk/setup0.h index 715cea602a..5045f30ea8 100644 --- a/include/wx/gtk/setup0.h +++ b/include/wx/gtk/setup0.h @@ -184,7 +184,7 @@ // Unicode support // ---------------------------------------------------------------------------- -// These settings are obsolete: the library is always built in Unicode mode +// This option is deprecated: the library should be always built in Unicode mode // now, only set wxUSE_UNICODE to 0 to compile legacy code in ANSI mode if // absolutely necessary -- updating it is strongly recommended as the ANSI mode // will disappear completely in future wxWidgets releases. @@ -192,9 +192,6 @@ #define wxUSE_UNICODE 1 #endif -// wxUSE_WCHAR_T is required by wxWidgets now, don't change. -#define wxUSE_WCHAR_T 1 - // ---------------------------------------------------------------------------- // global features // ---------------------------------------------------------------------------- diff --git a/include/wx/motif/setup0.h b/include/wx/motif/setup0.h index 5a5e8137ad..5644bfd481 100644 --- a/include/wx/motif/setup0.h +++ b/include/wx/motif/setup0.h @@ -184,7 +184,7 @@ // Unicode support // ---------------------------------------------------------------------------- -// These settings are obsolete: the library is always built in Unicode mode +// This option is deprecated: the library should be always built in Unicode mode // now, only set wxUSE_UNICODE to 0 to compile legacy code in ANSI mode if // absolutely necessary -- updating it is strongly recommended as the ANSI mode // will disappear completely in future wxWidgets releases. @@ -192,9 +192,6 @@ #define wxUSE_UNICODE 1 #endif -// wxUSE_WCHAR_T is required by wxWidgets now, don't change. -#define wxUSE_WCHAR_T 1 - // ---------------------------------------------------------------------------- // global features // ---------------------------------------------------------------------------- diff --git a/include/wx/msw/chkconf.h b/include/wx/msw/chkconf.h index baf02f7e4e..3ca6761472 100644 --- a/include/wx/msw/chkconf.h +++ b/include/wx/msw/chkconf.h @@ -175,14 +175,6 @@ # undef wxUSE_DEBUG_NEW_ALWAYS # define wxUSE_DEBUG_NEW_ALWAYS 0 -/* some Cygwin versions don't have wcslen */ -# if defined(__CYGWIN__) || defined(__CYGWIN32__) -# if ! ((__GNUC__>2) ||((__GNUC__==2) && (__GNUC_MINOR__>=95))) -# undef wxUSE_WCHAR_T -# define wxUSE_WCHAR_T 0 -# endif -#endif - #endif /* __GNUWIN32__ */ /* MinGW32 doesn't provide wincred.h defining the API needed by this */ diff --git a/include/wx/msw/setup0.h b/include/wx/msw/setup0.h index 1d1890f6cb..4f03064738 100644 --- a/include/wx/msw/setup0.h +++ b/include/wx/msw/setup0.h @@ -184,7 +184,7 @@ // Unicode support // ---------------------------------------------------------------------------- -// These settings are obsolete: the library is always built in Unicode mode +// This option is deprecated: the library should be always built in Unicode mode // now, only set wxUSE_UNICODE to 0 to compile legacy code in ANSI mode if // absolutely necessary -- updating it is strongly recommended as the ANSI mode // will disappear completely in future wxWidgets releases. @@ -192,9 +192,6 @@ #define wxUSE_UNICODE 1 #endif -// wxUSE_WCHAR_T is required by wxWidgets now, don't change. -#define wxUSE_WCHAR_T 1 - // ---------------------------------------------------------------------------- // global features // ---------------------------------------------------------------------------- diff --git a/include/wx/osx/setup0.h b/include/wx/osx/setup0.h index a04f3fad08..8daa03e568 100644 --- a/include/wx/osx/setup0.h +++ b/include/wx/osx/setup0.h @@ -190,7 +190,7 @@ // Unicode support // ---------------------------------------------------------------------------- -// These settings are obsolete: the library is always built in Unicode mode +// This option is deprecated: the library should be always built in Unicode mode // now, only set wxUSE_UNICODE to 0 to compile legacy code in ANSI mode if // absolutely necessary -- updating it is strongly recommended as the ANSI mode // will disappear completely in future wxWidgets releases. @@ -198,9 +198,6 @@ #define wxUSE_UNICODE 1 #endif -// wxUSE_WCHAR_T is required by wxWidgets now, don't change. -#define wxUSE_WCHAR_T 1 - // ---------------------------------------------------------------------------- // global features // ---------------------------------------------------------------------------- diff --git a/include/wx/setup_inc.h b/include/wx/setup_inc.h index 4706597287..6932a2c0db 100644 --- a/include/wx/setup_inc.h +++ b/include/wx/setup_inc.h @@ -180,7 +180,7 @@ // Unicode support // ---------------------------------------------------------------------------- -// These settings are obsolete: the library is always built in Unicode mode +// This option is deprecated: the library should be always built in Unicode mode // now, only set wxUSE_UNICODE to 0 to compile legacy code in ANSI mode if // absolutely necessary -- updating it is strongly recommended as the ANSI mode // will disappear completely in future wxWidgets releases. @@ -188,9 +188,6 @@ #define wxUSE_UNICODE 1 #endif -// wxUSE_WCHAR_T is required by wxWidgets now, don't change. -#define wxUSE_WCHAR_T 1 - // ---------------------------------------------------------------------------- // global features // ---------------------------------------------------------------------------- diff --git a/include/wx/univ/setup0.h b/include/wx/univ/setup0.h index c48db8d762..7e7ff0e8a9 100644 --- a/include/wx/univ/setup0.h +++ b/include/wx/univ/setup0.h @@ -183,7 +183,7 @@ // Unicode support // ---------------------------------------------------------------------------- -// These settings are obsolete: the library is always built in Unicode mode +// This option is deprecated: the library should be always built in Unicode mode // now, only set wxUSE_UNICODE to 0 to compile legacy code in ANSI mode if // absolutely necessary -- updating it is strongly recommended as the ANSI mode // will disappear completely in future wxWidgets releases. @@ -191,9 +191,6 @@ #define wxUSE_UNICODE 1 #endif -// wxUSE_WCHAR_T is required by wxWidgets now, don't change. -#define wxUSE_WCHAR_T 1 - // ---------------------------------------------------------------------------- // global features // ---------------------------------------------------------------------------- diff --git a/setup.h.in b/setup.h.in index fad308dc54..62fd583f36 100644 --- a/setup.h.in +++ b/setup.h.in @@ -182,8 +182,6 @@ #define wxUSE_UNICODE 0 #endif -#define wxUSE_WCHAR_T 0 - #define wxUSE_EXCEPTIONS 0 diff --git a/setup.h_vms b/setup.h_vms index 7b457b2a46..b3581318ef 100644 --- a/setup.h_vms +++ b/setup.h_vms @@ -218,8 +218,6 @@ typedef pid_t GPid; #endif #endif -#define wxUSE_WCHAR_T 1 - #define wxUSE_EXCEPTIONS 1 diff --git a/src/html/helpdata.cpp b/src/html/helpdata.cpp index 05af129704..6dcede915b 100644 --- a/src/html/helpdata.cpp +++ b/src/html/helpdata.cpp @@ -502,16 +502,12 @@ bool wxHtmlHelpData::AddBookParam(const wxFSFile& bookfile, const wxString& indexfile, const wxString& deftopic, const wxString& path) { -#if wxUSE_WCHAR_T - #if wxUSE_UNICODE - #define CORRECT_STR(str, conv) \ - str = wxString((str).mb_str(wxConvISO8859_1), conv) - #else - #define CORRECT_STR(str, conv) \ - str = wxString((str).wc_str(conv), wxConvLocal) - #endif +#if wxUSE_UNICODE + #define CORRECT_STR(str, conv) \ + str = wxString((str).mb_str(wxConvISO8859_1), conv) #else - #define CORRECT_STR(str, conv) + #define CORRECT_STR(str, conv) \ + str = wxString((str).wc_str(conv), wxConvLocal) #endif wxFileSystem fsys;