mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	Create a new macro that can be shared between projects to check for __thread support by the compiler. This macro might come useful for xine-lib too so I want to keep it separate for easier importing it over. Name the defined macro SUPPORT_TLS___THREAD to follow the same style as the checks from attributes.m4.
		
			
				
	
	
		
			17 lines
		
	
	
	
		
			496 B
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
	
		
			496 B
		
	
	
	
		
			Text
		
	
	
	
	
	
AC_DEFUN([CC_CHECK_TLS], [
 | 
						|
  AC_CACHE_CHECK([whether $CC knows __thread for Thread-Local Storage],
 | 
						|
    cc_cv_tls___thread,
 | 
						|
    [AC_COMPILE_IFELSE(
 | 
						|
      AC_LANG_PROGRAM(
 | 
						|
        [[static __thread int a = 6;]],
 | 
						|
        [[a = 5;]]),
 | 
						|
      [cc_cv_tls___thread=yes],
 | 
						|
      [cc_cv_tls___thread=no])
 | 
						|
    ])
 | 
						|
  
 | 
						|
  AS_IF([test "x$cc_cv_tls___thread" = "xyes"],
 | 
						|
    [AC_DEFINE([SUPPORT_TLS___THREAD], 1,
 | 
						|
     [Define this if the compiler supports __thread for Thread-Local Storage])
 | 
						|
     $1],
 | 
						|
    [$2])
 | 
						|
])
 |