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
This commit is contained in:
Vadim Zeitlin
2004-09-27 17:20:55 +00:00
parent 3e79fa7534
commit fb3c904254

View File

@@ -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 <string>
#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