mirror of
https://code.videolan.org/videolan/vlc
synced 2024-08-31 06:46:39 +02:00
vlc_fixup: Provide a thread_local macro
This commit is contained in:
parent
91fed327a3
commit
d0e2ad922a
11
configure.ac
11
configure.ac
@ -757,6 +757,17 @@ AC_CHECK_LIB(m,sincos, [
|
|||||||
AC_LIBOBJ([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
|
dnl Check for dynamic plugins
|
||||||
LIBDL=""
|
LIBDL=""
|
||||||
have_dynamic_objects="no"
|
have_dynamic_objects="no"
|
||||||
|
@ -45,6 +45,18 @@
|
|||||||
# endif
|
# endif
|
||||||
#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) \
|
#if !defined (HAVE_GMTIME_R) || !defined (HAVE_LOCALTIME_R) \
|
||||||
|| !defined (HAVE_TIMEGM)
|
|| !defined (HAVE_TIMEGM)
|
||||||
# include <time.h> /* time_t */
|
# include <time.h> /* time_t */
|
||||||
|
Loading…
Reference in New Issue
Block a user