From dfced56c57e34e0109fb8614430ed77504490ddd Mon Sep 17 00:00:00 2001 From: Vladislav Shchapov Date: Thu, 21 Dec 2023 21:19:34 +0500 Subject: [PATCH] Remove unused Z_TLS and HAVE_THREAD_LOCAL Signed-off-by: Vladislav Shchapov --- CMakeLists.txt | 15 --------------- configure | 16 ---------------- zbuild.h | 14 -------------- 3 files changed, 45 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0cbc69a6..58ed3a1a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -427,21 +427,6 @@ if(HAVE_ATTRIBUTE_ALIGNED) add_definitions(-DHAVE_ATTRIBUTE_ALIGNED) endif() -# -# check for _Thread_local() support in the compiler -# -check_c_source_compiles( - "_Thread_local int test; - int main(void) { - (void)test; - return 0; - }" - HAVE_THREAD_LOCAL -) -if(HAVE_THREAD_LOCAL) - add_definitions(-DHAVE_THREAD_LOCAL) -endif() - # # check for __builtin_ctz() support in the compiler # diff --git a/configure b/configure index 501f51ba..e0187be0 100755 --- a/configure +++ b/configure @@ -973,22 +973,6 @@ else echo "Checking for attribute(aligned) ... No." | tee -a configure.log fi -# Check for _Thread_local support in compiler -cat > $test.c << EOF -_Thread_local int test; -int main(void) { - (void)test; - return 0; -} -EOF -if try ${CC} ${CFLAGS} $test.c $LDSHAREDLIBC; then - echo "Checking for _Thread_local ... Yes." | tee -a configure.log - CFLAGS="$CFLAGS -DHAVE_THREAD_LOCAL" - SFLAGS="$SFLAGS -DHAVE_THREAD_LOCAL" -else - echo "Checking for _Thread_local ... No." | tee -a configure.log -fi - # Check for __builtin_ctz() support in compiler cat > $test.c << EOF long f(unsigned int x) { return __builtin_ctz(x); } diff --git a/zbuild.h b/zbuild.h index d78c3a15..d550b4c5 100644 --- a/zbuild.h +++ b/zbuild.h @@ -31,20 +31,6 @@ # endif #endif -/* Determine compiler support for TLS */ -#ifndef Z_TLS -# ifdef HAVE_THREAD_LOCAL -# define Z_TLS _Thread_local -# elif defined(__GNUC__) || defined(__SUNPRO_C) -# define Z_TLS __thread -# elif defined(_WIN32) && (defined(_MSC_VER) || defined(__ICL)) -# define Z_TLS __declspec(thread) -# else -# warning Unable to detect Thread Local Storage support. -# define Z_TLS -# endif -#endif - #ifndef Z_HAS_ATTRIBUTE # if defined(__has_attribute) # define Z_HAS_ATTRIBUTE(a) __has_attribute(a) -- 2.47.2