From fb3c9042543e8e0ee533eff7be4b2bdc2e9eb84e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 27 Sep 2004 17:20:55 +0000 Subject: [PATCH] fix crash when calling wxGetEmptyString() with wxUSE_STL == 1 (bug 1028804) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29456 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/string.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/include/wx/string.h b/include/wx/string.h index e05371a9e4..888a1faaf4 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -55,6 +55,8 @@ #include "wx/buffer.h" // for wxCharBuffer #include "wx/strconv.h" // for wxConvertXXX() macros and wxMBConv classes +class WXDLLIMPEXP_BASE wxString; + // --------------------------------------------------------------------------- // macros // --------------------------------------------------------------------------- @@ -164,12 +166,11 @@ inline int Stricmp(const char *psz1, const char *psz2) #endif // OS/compiler } -// return an empty wxString -class WXDLLIMPEXP_BASE wxString; // not yet defined -inline const wxString& wxGetEmptyString() { return *(wxString *)&wxEmptyString; } - #if wxUSE_STL +// return an empty wxString (doesn't make much sense with wxUSE_STL == 1) +inline const wxString wxGetEmptyString() { wxString(); } + #include "wx/beforestd.h" #include #include "wx/afterstd.h" @@ -191,6 +192,9 @@ inline const wxString& wxGetEmptyString() { return *(wxString *)&wxEmptyString; #else // if !wxUSE_STL +// return an empty wxString +inline const wxString& wxGetEmptyString() { return *(wxString *)&wxEmptyString; } + #ifndef HAVE_STD_STRING_COMPARE #define HAVE_STD_STRING_COMPARE #endif -- 2.45.2