Use _Thread_local to solve threads.h build issue (#1053)

Apparently this will fail to compile in some masOS version.
And internet claims _Thread_local is portable.

Fixes #1051.

Signed-off-by: Binbin <binloveplay1314@qq.com>
This commit is contained in:
Binbin 2024-09-22 20:20:55 +08:00 committed by GitHub
parent 56c90b78e3
commit d07c29791a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -88,11 +88,7 @@ void zlibc_free(void *ptr) {
#define dallocx(ptr, flags) je_dallocx(ptr, flags)
#endif
#if __STDC_NO_THREADS__
#define thread_local __thread
#else
#include <threads.h>
#endif
#define thread_local _Thread_local
#define MAX_THREADS_NUM (IO_THREADS_MAX_NUM + 3 + 1)
/* A thread-local storage which keep the current thread's index in the used_memory_thread array. */