access TLS cache variable directly and not via a helper function when using compiler with native TLS support to work around an apparent bug in g++

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55501 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-09-06 22:12:04 +00:00
parent 36eca86160
commit e810df36b3
2 changed files with 29 additions and 9 deletions

View File

@@ -60,6 +60,12 @@ const size_t wxString::npos = (size_t) -1;
#if wxUSE_STRING_POS_CACHE
#ifdef wxHAS_COMPILER_TLS
wxTLS_TYPE(wxString::Cache) wxString::ms_cache;
#else // !wxHAS_COMPILER_TLS
struct wxStrCacheInitializer
{
wxStrCacheInitializer()
@@ -72,6 +78,8 @@ struct wxStrCacheInitializer
static wxStrCacheInitializer gs_stringCacheInit;
#endif // wxHAS_COMPILER_TLS/!wxHAS_COMPILER_TLS
// gdb seems to be unable to display thread-local variables correctly, at least
// not my 6.4.98 version under amd64, so provide this debugging helper to do it
#ifdef __WXDEBUG__