Merge branch 'always-use-thread-local'

Always use thread_local as we can rely on compiler TLS support working
under Windows 7 and later.

There are some known problems in MinGW thread local variable support,
but they only affect (obsolete) 32-bit builds and will hopefully be
fixed in this compiler soon.

See #22917.
This commit is contained in:
Vadim Zeitlin 2022-11-10 16:32:42 +01:00
commit b4b23ac423
29 changed files with 55 additions and 814 deletions

View file

@ -85,7 +85,6 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
wx/unix/evtloopsrc.h
wx/unix/pipe.h
wx/unix/stackwalk.h
wx/unix/tls.h
wx/unix/fswatcher_kqueue.h
</set>

View file

@ -28,7 +28,6 @@ set(BASE_UNIX_AND_DARWIN_HDR
wx/unix/evtloopsrc.h
wx/unix/pipe.h
wx/unix/stackwalk.h
wx/unix/tls.h
wx/unix/fswatcher_kqueue.h
)

View file

@ -85,7 +85,6 @@ if(NOT WIN32)
wx_dependent_option(wxUSE_UTF8_LOCALE_ONLY "only support UTF-8 locales in UTF-8 build (Unix only)" ON "wxUSE_UNICODE_UTF8" OFF)
endif()
wx_option(wxUSE_COMPILER_TLS "enable use of compiler TLS support")
if(NOT WIN32)
wx_option(wxUSE_VISIBILITY "use of ELF symbols visibility")
endif()

View file

@ -441,19 +441,10 @@ if(CMAKE_USE_PTHREADS_INIT)
message(WARNING "wxMutex won't be recursive on this platform")
endif()
endif()
if(wxUSE_COMPILER_TLS)
# test for compiler thread-specific variables support
wx_check_c_source_compiles("
static __thread int n = 0;
static __thread int *p = 0;"
HAVE___THREAD_KEYWORD
pthread.h
)
wx_check_cxx_source_compiles(
"void foo(abi::__forced_unwind&);"
HAVE_ABI_FORCEDUNWIND
cxxabi.h)
endif()
wx_check_cxx_source_compiles(
"void foo(abi::__forced_unwind&);"
HAVE_ABI_FORCEDUNWIND
cxxabi.h)
cmake_pop_check_state()
endif() # CMAKE_USE_PTHREADS_INIT

View file

@ -168,8 +168,6 @@
#cmakedefine01 wxUSE_PRINTF_POS_PARAMS
#cmakedefine01 wxUSE_COMPILER_TLS
#cmakedefine01 wxUSE_STL

View file

@ -48,7 +48,6 @@ BASE_UNIX_AND_DARWIN_HDR =
wx/unix/evtloopsrc.h
wx/unix/pipe.h
wx/unix/stackwalk.h
wx/unix/tls.h
wx/unix/fswatcher_kqueue.h
# Files used on all Unix systems, including Darwin with any port but wxMac

View file

@ -390,10 +390,6 @@ def main(scriptName, args):
flags["wxUSE_AFM_FOR_POSTSCRIPT"] = "0"
flags["wxUSE_DATEPICKCTRL_GENERIC"] = "1"
# Remove this when Windows XP finally dies, or when there is a
# solution for ticket #13116...
flags["wxUSE_COMPILER_TLS"] = "0"
if VERSION < (2,9):
flags["wxUSE_DIB_FOR_BITMAP"] = "1"