compiler.h: also check threads.h exists

In file included from ../src/log.h:8,
                 from ../src/backend/gl/glx.h:18,
                 from ../src/common.h:45,
                 from ../src/picom.c:32:
../src/compiler.h:98:11: fatal error: threads.h: No such file or directory
   98 | # include <threads.h>
      |           ^~~~~~~~~~~
This commit is contained in:
Jan Beich 2019-12-24 11:53:19 +00:00
parent e1d9e9535e
commit e54058fcc7
1 changed files with 5 additions and 1 deletions

View File

@ -94,7 +94,11 @@
# define unreachable do {} while(0)
#endif
#ifndef __STDC_NO_THREADS__
#ifndef __has_include
# define __has_include(x) 0
#endif
#if !defined(__STDC_NO_THREADS__) && __has_include(<threads.h>)
# include <threads.h>
#elif __STDC_VERSION__ >= 201112L
# define thread_local _Thread_local