diff --git a/build/cmake/setup.cmake b/build/cmake/setup.cmake index bbe32bbdbe..54757bc048 100644 --- a/build/cmake/setup.cmake +++ b/build/cmake/setup.cmake @@ -144,12 +144,6 @@ wx_check_cxx_source_compiles(" string ) -wx_check_cxx_source_compiles( - "std::wstring s;" - HAVE_STD_WSTRING - string - ) - wx_check_cxx_source_compiles(" std::hash_map, std::equal_to > test1; std::hash_set, std::equal_to > test2;" diff --git a/build/cmake/setup.h.in b/build/cmake/setup.h.in index 2cad3ee947..d3d047dc5f 100644 --- a/build/cmake/setup.h.in +++ b/build/cmake/setup.h.in @@ -741,10 +741,6 @@ */ #cmakedefine VA_LIST_IS_ARRAY 1 -/* - * Define if your compiler has std::wstring - */ -#cmakedefine HAVE_STD_WSTRING 1 /* * Define if your compiler has compliant std::string::compare */ diff --git a/configure b/configure index 2767e097c3..4cd996c34f 100755 --- a/configure +++ b/configure @@ -24728,8 +24728,6 @@ if test "x$COMPAQCXX" = "xyes"; then CXXFLAGS="-w0 -msg_disable basclsnondto,unrimpret,intconlosbit" fi -$as_echo "#define HAVE_STD_WSTRING 1" >>confdefs.h - $as_echo "#define HAVE_STD_STRING_COMPARE 1" >>confdefs.h $as_echo "#define HAVE_STD_UNORDERED_MAP 1" >>confdefs.h diff --git a/configure.in b/configure.in index 008cad8d3a..e88588b316 100644 --- a/configure.in +++ b/configure.in @@ -1880,7 +1880,6 @@ if test "x$COMPAQCXX" = "xyes"; then CXXFLAGS="-w0 -msg_disable basclsnondto,unrimpret,intconlosbit" fi -AC_DEFINE(HAVE_STD_WSTRING) AC_DEFINE(HAVE_STD_STRING_COMPARE) AC_DEFINE(HAVE_STD_UNORDERED_MAP) AC_DEFINE(HAVE_STD_UNORDERED_SET) diff --git a/include/wx/defs.h b/include/wx/defs.h index 928419066b..64486b198a 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -315,10 +315,6 @@ typedef short int WXTYPE; /* for consistency with wxStatic/DynamicCast defined in wx/object.h */ #define wxConstCast(obj, className) const_cast(obj) -#ifndef HAVE_STD_WSTRING - #define HAVE_STD_WSTRING -#endif - #ifndef HAVE_STD_STRING_COMPARE #define HAVE_STD_STRING_COMPARE #endif diff --git a/include/wx/osx/config_xcode.h b/include/wx/osx/config_xcode.h index 75f31a2c8f..0d905b21a5 100644 --- a/include/wx/osx/config_xcode.h +++ b/include/wx/osx/config_xcode.h @@ -22,7 +22,6 @@ #define wx_USE_NANOX 0 #define HAVE_VA_COPY 1 -#define HAVE_STD_WSTRING 1 #if __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 2 ) #if !defined(__has_include) #define HAVE_TR1_UNORDERED_MAP 1 diff --git a/include/wx/string.h b/include/wx/string.h index 6df615e1e9..955bdf2fbe 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -1239,9 +1239,9 @@ public: // they need it #if wxUSE_STD_STRING #if wxUSE_UNICODE_WCHAR - wxString(const wxStdWideString& str) : m_impl(str) {} + wxString(const std::wstring& str) : m_impl(str) {} #else // UTF-8 or ANSI - wxString(const wxStdWideString& str) + wxString(const std::wstring& str) { assign(str.c_str(), str.length()); } #endif @@ -1262,12 +1262,12 @@ public: // We can avoid a copy if we already use this string type internally, // otherwise we create a copy on the fly: #if wxUSE_UNICODE_WCHAR && wxUSE_STL_BASED_WXSTRING - #define wxStringToStdWstringRetType const wxStdWideString& - const wxStdWideString& ToStdWstring() const { return m_impl; } + #define wxStringToStdWstringRetType const std::wstring& + const std::wstring& ToStdWstring() const { return m_impl; } #else // wxStringImpl is either not std::string or needs conversion - #define wxStringToStdWstringRetType wxStdWideString - wxStdWideString ToStdWstring() const + #define wxStringToStdWstringRetType std::wstring + std::wstring ToStdWstring() const { #if wxUSE_UNICODE_WCHAR wxScopedWCharBuffer buf = @@ -1276,7 +1276,7 @@ public: wxScopedWCharBuffer buf(wc_str()); #endif - return wxStdWideString(buf.data(), buf.length()); + return std::wstring(buf.data(), buf.length()); } #endif diff --git a/include/wx/stringimpl.h b/include/wx/stringimpl.h index d10242e7a4..37ccca1066 100644 --- a/include/wx/stringimpl.h +++ b/include/wx/stringimpl.h @@ -66,14 +66,11 @@ extern WXDLLIMPEXP_DATA_BASE(const wxStringCharType*) wxEmptyStringImpl; #include #include "wx/afterstd.h" -#ifdef HAVE_STD_WSTRING - typedef std::wstring wxStdWideString; -#else - typedef std::basic_string wxStdWideString; -#endif +// Define this for compatibility only, it is not used any longer. +typedef std::wstring wxStdWideString; #if wxUSE_UNICODE_WCHAR - typedef wxStdWideString wxStdString; + typedef std::wstring wxStdString; #else typedef std::string wxStdString; #endif diff --git a/include/wx/strvararg.h b/include/wx/strvararg.h index f80298bc22..935d0a05f9 100644 --- a/include/wx/strvararg.h +++ b/include/wx/strvararg.h @@ -816,10 +816,10 @@ struct wxArgNormalizerWchar #endif // NO_IMPLICIT_WXSTRING_ENCODING template<> -struct wxArgNormalizerWchar +struct wxArgNormalizerWchar : public wxArgNormalizerWchar { - wxArgNormalizerWchar(const wxStdWideString& s, + wxArgNormalizerWchar(const std::wstring& s, const wxFormatString *fmt, unsigned index) : wxArgNormalizerWchar(s.c_str(), fmt, index) {} }; @@ -850,10 +850,10 @@ struct wxArgNormalizerUtf8 #endif // wxNO_IMPLICIT_WXSTRING_ENCODING template<> -struct wxArgNormalizerUtf8 +struct wxArgNormalizerUtf8 : public wxArgNormalizerUtf8 { - wxArgNormalizerUtf8(const wxStdWideString& s, + wxArgNormalizerUtf8(const std::wstring& s, const wxFormatString *fmt, unsigned index) : wxArgNormalizerUtf8(s.c_str(), fmt, index) {} }; @@ -865,7 +865,7 @@ WX_ARG_NORMALIZER_FORWARD(std::string, const std::string&); WX_ARG_NORMALIZER_FORWARD(std::string_view, const std::string_view&); #endif // __cpp_lib_string_view #endif -WX_ARG_NORMALIZER_FORWARD(wxStdWideString, const wxStdWideString&); +WX_ARG_NORMALIZER_FORWARD(std::wstring, const std::wstring&); #endif // wxUSE_STD_STRING diff --git a/include/wx/variant.h b/include/wx/variant.h index 442dcd443a..432843da1f 100644 --- a/include/wx/variant.h +++ b/include/wx/variant.h @@ -243,14 +243,14 @@ public: operator std::string() const { return (operator wxString()).ToStdString(); } #endif // wxNO_IMPLICIT_WXSTRING_ENCODING - wxVariant(const wxStdWideString& val, const wxString& name = wxEmptyString); - bool operator==(const wxStdWideString& value) const + wxVariant(const std::wstring& val, const wxString& name = wxEmptyString); + bool operator==(const std::wstring& value) const { return operator==(wxString(value)); } - bool operator!=(const wxStdWideString& value) const + bool operator!=(const std::wstring& value) const { return operator!=(wxString(value)); } - wxVariant& operator=(const wxStdWideString& value) + wxVariant& operator=(const std::wstring& value) { return operator=(wxString(value)); } - operator wxStdWideString() const { return (operator wxString()).ToStdWstring(); } + operator std::wstring() const { return (operator wxString()).ToStdWstring(); } #endif // wxUSE_STD_STRING // wxUniChar diff --git a/setup.h.in b/setup.h.in index 643f6260c3..a238a19ba7 100644 --- a/setup.h.in +++ b/setup.h.in @@ -741,10 +741,6 @@ */ #undef VA_LIST_IS_ARRAY -/* - * Define if your compiler has std::wstring - */ -#undef HAVE_STD_WSTRING /* * Define if your compiler has compliant std::string::compare */ diff --git a/setup.h_vms b/setup.h_vms index 1f761fa82d..3fbbf568b2 100644 --- a/setup.h_vms +++ b/setup.h_vms @@ -808,19 +808,11 @@ typedef pid_t GPid; #undef VA_LIST_IS_ARRAY #if defined(__NAMESPACE_STD) && !defined(__NAMESPACE_STD_ONLY) -/* - * Define if your compiler has std::wstring - */ -#define HAVE_STD_WSTRING 1 /* * Define if your compiler has compliant std::string::compare */ #define HAVE_STD_STRING_COMPARE 1 #else -/* - * Define if your compiler has std::wstring - */ -/* #unfine HAVE_STD_WSTRING */ /* * Define if your compiler has compliant std::string::compare */ diff --git a/src/common/variant.cpp b/src/common/variant.cpp index cacec0b085..9fd4840c6d 100644 --- a/src/common/variant.cpp +++ b/src/common/variant.cpp @@ -976,7 +976,7 @@ wxVariant::wxVariant(const std::string& val, const wxString& name) m_name = name; } -wxVariant::wxVariant(const wxStdWideString& val, const wxString& name) +wxVariant::wxVariant(const std::wstring& val, const wxString& name) { m_refData = new wxVariantDataString(wxString(val)); m_name = name; diff --git a/tests/strings/stdstrings.cpp b/tests/strings/stdstrings.cpp index 349a126be5..56d2afc0ec 100644 --- a/tests/strings/stdstrings.cpp +++ b/tests/strings/stdstrings.cpp @@ -526,7 +526,7 @@ TEST_CASE("StdString::Substr", "[stdstring]") TEST_CASE("StdString::Conversion", "[stdstring]") { std::string strStd("std::string value"); - wxStdWideString strStdWide(L"std::wstring value"); + std::wstring strStdWide(L"std::wstring value"); wxString s1(strStd); CHECK( s1 == "std::string value" ); @@ -553,9 +553,9 @@ TEST_CASE("StdString::Conversion", "[stdstring]") CHECK( s5 == "hello" ); #if wxUSE_STL - wxStdWideString s6 = s4; + std::wstring s6 = s4; #else - wxStdWideString s6 = s4.ToStdWstring(); + std::wstring s6 = s4.ToStdWstring(); #endif CHECK( s6 == "hello" ); @@ -564,7 +564,7 @@ TEST_CASE("StdString::Conversion", "[stdstring]") CHECK( s7 == "hello" ); #endif - wxStdWideString s8(s4); + std::wstring s8(s4); CHECK( s8 == "hello" ); #if wxUSE_UNICODE