Git init
[framework/multimedia/pulseaudio.git] / m4 / tls.m4
1 AC_DEFUN([CC_CHECK_TLS], [
2   AC_CACHE_CHECK([whether $CC knows __thread for Thread-Local Storage],
3     cc_cv_tls___thread,
4     [AC_COMPILE_IFELSE(
5       AC_LANG_PROGRAM(
6         [[static __thread int a = 6;]],
7         [[a = 5;]]),
8       [cc_cv_tls___thread=yes],
9       [cc_cv_tls___thread=no])
10     ])
11   
12   AS_IF([test "x$cc_cv_tls___thread" = "xyes"],
13     [AC_DEFINE([SUPPORT_TLS___THREAD], 1,
14      [Define this if the compiler supports __thread for Thread-Local Storage])
15      $1],
16     [$2])
17 ])