git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53475
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
- Added wxON_BLOCK_EXIT_SET() and wxON_BLOCK_EXIT_NULL() to wx/scopeguard.h.
- Added wxEvtHandler::QueueEvent() replacing AddPendingEvent() and
wxQueueEvent() replacing wxPostEvent().
- Added wxON_BLOCK_EXIT_SET() and wxON_BLOCK_EXIT_NULL() to wx/scopeguard.h.
- Added wxEvtHandler::QueueEvent() replacing AddPendingEvent() and
wxQueueEvent() replacing wxPostEvent().
+- wxString now uses std::[w]string internally by default, meaning that it is
+ now thread-safe if the standard library provided with your compiler is.
@beginDefList
@itemdef{wxUSE_STL, Container classes and wxString are implemented using
standard classes and provide the same standard API.}
@beginDefList
@itemdef{wxUSE_STL, Container classes and wxString are implemented using
standard classes and provide the same standard API.}
+@itemdef{wxUSE_STD_STRING, wxString is implemented using std::[w]string and can
+ be constructed from it (but provides wxWidgets-compatible API, in
+ particular is implicitly convertible to @c char* and not std::[w]string).}
@itemdef{wxUSE_STD_IOSTREAM, Standard C++ classes are used instead of or in
addition to wx stream classes.}
@itemdef{wxUSE_STD_IOSTREAM, Standard C++ classes are used instead of or in
addition to wx stream classes.}
-@itemdef{wxUSE_STD_STRING, wxString can be constructed from std::string (but
- provides wxWidgets-compatible API).}
@itemdef{wxUSE_UNICODE, Compiled with Unicode support (default in wxWidgets
3.0, non-Unicode build will be deprecated in the future).}
@itemdef{wxUSE_UNICODE_WCHAR, wxString uses wchar_t buffer for internal storage
@itemdef{wxUSE_UNICODE, Compiled with Unicode support (default in wxWidgets
3.0, non-Unicode build will be deprecated in the future).}
@itemdef{wxUSE_UNICODE_WCHAR, wxString uses wchar_t buffer for internal storage
// deal with STL/non-STL/non-STL-but-wxUSE_STD_STRING
// ----------------------------------------------------------------------------
// deal with STL/non-STL/non-STL-but-wxUSE_STD_STRING
// ----------------------------------------------------------------------------
-#define wxUSE_STL_BASED_WXSTRING wxUSE_STL
+// using STL implies using std::string
+#if wxUSE_STL
+ #undef wxUSE_STD_STRING
+ #define wxUSE_STD_STRING 1
+#endif
+
+// we use STL-based string internally if we use std::string at all now, there
+// should be no reason to prefer our internal implement but if you really need
+// it you can predefine wxUSE_STL_BASED_WXSTRING as 0 when building the library
+#ifndef wxUSE_STL_BASED_WXSTRING
+ #define wxUSE_STL_BASED_WXSTRING wxUSE_STD_STRING
+#endif
// in both cases we need to define wxStdString
#if wxUSE_STL_BASED_WXSTRING || wxUSE_STD_STRING
// in both cases we need to define wxStdString
#if wxUSE_STL_BASED_WXSTRING || wxUSE_STD_STRING