Commit d0e2ad92 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

vlc_fixup: Provide a thread_local macro

parent 91fed327
......@@ -757,6 +757,17 @@ AC_CHECK_LIB(m,sincos, [
AC_LIBOBJ([sincos])
])
AC_MSG_CHECKING([_Thread_local support])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_Thread_local int foo = 0;
int main() {}])], [
AC_MSG_RESULT([ok])
AC_DEFINE(HAVE_THREAD_LOCAL, 1, [Defined to 1 if C11 _Thread_local storage qualifier is supported])
],[ AC_MSG_RESULT([no])])
dnl __STDC_NO_THREADS__ can't be trusted on some platforms.
dnl check for its availability explicitely
AC_CHECK_HEADERS([threads.h])
dnl Check for dynamic plugins
LIBDL=""
have_dynamic_objects="no"
......
......@@ -45,6 +45,18 @@
# endif
#endif
#ifndef __cplusplus
# ifdef HAVE_THREADS_H
# include <threads.h>
# elif !defined(thread_local)
# ifdef HAVE_THREAD_LOCAL
# define thread_local _Thread_local
# elif defined(_MSC_VER)
# define thread_local __declspec(thread)
# endif
# endif
#endif
#if !defined (HAVE_GMTIME_R) || !defined (HAVE_LOCALTIME_R) \
|| !defined (HAVE_TIMEGM)
# include <time.h> /* time_t */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment