From 634359bb169311646f6369b21f0c90a9819fe2ce Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 5 Oct 2023 12:55:56 -0400 Subject: thread: Define thread_local --- src/thread.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/thread.h') diff --git a/src/thread.h b/src/thread.h index 45b5e1f..ab95a79 100644 --- a/src/thread.h +++ b/src/thread.h @@ -8,11 +8,20 @@ #ifndef BFS_THREAD_H #define BFS_THREAD_H +#include "config.h" #include "diag.h" #include #include #include +#if __STDC_VERSION__ < 202311L && !defined(thread_local) +# if BFS_USE_THREADS_H +# include +# else +# define thread_local _Thread_local +# endif +#endif + #define thread_verify(expr, cond) \ bfs_verify((errno = (expr), (cond)), "%s: %s", #expr, strerror(errno)) -- cgit v1.2.3