From 2d3c25cd8588d86c3c3c84a5ad81f75c9ac67f1d Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Mon, 13 Mar 2023 23:45:28 +0100 Subject: [PATCH] TCC doesn't support the __thread attribute, which is a GCC extension. Use this extension only for GCC. --- m-thread.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/m-thread.h b/m-thread.h index 1e0b2bdb..34237641 100644 --- a/m-thread.h +++ b/m-thread.h @@ -480,7 +480,11 @@ static inline void m_once_call(m_once_t o, void (*func)(void)) pthread_once(o,func); } -#define M_THREAD_ATTR __thread +#ifdef defined(__GNUC__) +# define M_THREAD_ATTR __thread +#else +# define M_THREAD_ATTR /* Not supported */ +#endif M_END_PROTECTED_CODE