Remove wxUSE_COMPILER_TLS and always use C++11 thread_local

Don't use compiler-specific __thread and use the standard keyword
instead.

Keep the existing TLS-related macros for compatibility, but remove our
custom implementation of them, so that they're always trivial now.
This commit is contained in:
Vadim Zeitlin 2022-10-26 02:02:32 +01:00
parent 5845312825
commit 4e802e6fc7
24 changed files with 45 additions and 734 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

@ -86,7 +86,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

@ -173,8 +173,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

@ -392,10 +392,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"