From 5778fea4da95fd4318e9f8af9c25066eec81cb8d Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Sat, 9 May 2020 09:08:09 +0200 Subject: [PATCH] CLEANUP: remove THREAD_LOCAL from config.h This one really ought to be defined in hathreads.h like all other thread definitions, which is what this patch does. As expected, all files but one (regex.h) were already including hathreads.h when using THREAD_LOCAL; regex.h was fixed for this. This was the last entry in config.h which is now useless. --- include/common/config.h | 6 ------ include/common/hathreads.h | 3 +++ include/common/regex.h | 1 + 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/include/common/config.h b/include/common/config.h index 365705c4c3..30da555e1b 100644 --- a/include/common/config.h +++ b/include/common/config.h @@ -26,10 +26,4 @@ #include #include -#ifdef USE_THREAD -#define THREAD_LOCAL __thread -#else -#define THREAD_LOCAL -#endif - #endif /* _COMMON_CONFIG_H */ diff --git a/include/common/hathreads.h b/include/common/hathreads.h index cc54574fad..ae1009a9f9 100644 --- a/include/common/hathreads.h +++ b/include/common/hathreads.h @@ -44,6 +44,7 @@ #ifndef USE_THREAD +#define THREAD_LOCAL /* empty */ #define MAX_THREADS 1 #define MAX_THREADS_MASK 1 @@ -258,6 +259,8 @@ static inline unsigned long thread_isolated() #include #include +#define THREAD_LOCAL __thread + #ifndef MAX_THREADS #define MAX_THREADS LONGBITS #endif diff --git a/include/common/regex.h b/include/common/regex.h index 0069b2d1e1..066f07edda 100644 --- a/include/common/regex.h +++ b/include/common/regex.h @@ -26,6 +26,7 @@ #include #include +#include #ifdef USE_PCRE #include -- 2.47.3