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
#
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); }
# 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)