From e54058fcc7406e374fa0969da9974d5c5351c756 Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Tue, 24 Dec 2019 11:53:19 +0000 Subject: [PATCH] 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 | ^~~~~~~~~~~ --- src/compiler.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/compiler.h b/src/compiler.h index de5c17c..814bdd8 100644 --- a/src/compiler.h +++ b/src/compiler.h @@ -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() # include #elif __STDC_VERSION__ >= 201112L # define thread_local _Thread_local