X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8c3b65d941ffaf5c207881ca56bfe9c37b3604c5..c70d645d7f85d410fa8e25c3921f5f1c775c332c:/src/common/string.cpp diff --git a/src/common/string.cpp b/src/common/string.cpp index 82acf49d86..595caf7125 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -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() @@ -70,8 +76,19 @@ struct wxStrCacheInitializer } }; +/* +wxString::Cache& wxString::GetCache() +{ + static wxTLS_TYPE(Cache) s_cache; + + return wxTLS_VALUE(s_cache); +} +*/ + 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__ @@ -2106,10 +2123,14 @@ wxUTF8StringBufferLength::~wxUTF8StringBufferLength() // wxCharBufferType // ---------------------------------------------------------------------------- +#ifndef __VMS_BROKEN_TEMPLATES template<> +#endif wxCharTypeBuffer::Data wxCharTypeBuffer::NullData(NULL); +#ifndef __VMS_BROKEN_TEMPLATES template<> +#endif wxCharTypeBuffer::Data wxCharTypeBuffer::NullData(NULL);