From 07170120ee06625fead8c72ad537bf41fa3ed8a9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 28 Sep 2004 09:50:23 +0000 Subject: [PATCH] blind fix for wxGetEmptyString() compilation with wxUSE_STL == 1 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29487 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/string.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/include/wx/string.h b/include/wx/string.h index 888a1faaf4..56ef478ee8 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -168,9 +168,6 @@ inline int Stricmp(const char *psz1, const char *psz2) #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" @@ -192,9 +189,6 @@ inline const wxString wxGetEmptyString() { wxString(); } #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 @@ -1291,6 +1285,17 @@ public: #include "wx/arrstr.h" #endif +#if wxUSE_STL + // return an empty wxString (not very useful with wxUSE_STL == 1) + inline const wxString wxGetEmptyString() { wxString(); } +#else // !wxUSE_STL + // return an empty wxString (more efficient than wxString() here) + inline const wxString& wxGetEmptyString() + { + return *(wxString *)&wxEmptyString; + } +#endif // wxUSE_STL/!wxUSE_STL + // ---------------------------------------------------------------------------- // wxStringBuffer: a tiny class allowing to get a writable pointer into string // ---------------------------------------------------------------------------- -- 2.47.2