Adding the preprocessor value DISABLE_THREAD_SUPPORT to allow compilation of glslang without thread support for WASI.
This commit is contained in:
parent
ea087ff90d
commit
20490a11aa
2 changed files with 18 additions and 2 deletions
|
|
@ -35,14 +35,21 @@
|
|||
#include "../Include/Common.h"
|
||||
#include "../Include/PoolAlloc.h"
|
||||
|
||||
// Mostly here for target that do not support threads such as WASI.
|
||||
#ifdef DISABLE_THREAD_SUPPORT
|
||||
#define THREAD_LOCAL
|
||||
#else
|
||||
#define THREAD_LOCAL thread_local
|
||||
#endif
|
||||
|
||||
namespace glslang {
|
||||
|
||||
namespace {
|
||||
thread_local TPoolAllocator* threadPoolAllocator = nullptr;
|
||||
THREAD_LOCAL TPoolAllocator* threadPoolAllocator = nullptr;
|
||||
|
||||
TPoolAllocator* GetDefaultThreadPoolAllocator()
|
||||
{
|
||||
thread_local TPoolAllocator defaultAllocator;
|
||||
THREAD_LOCAL TPoolAllocator defaultAllocator;
|
||||
return &defaultAllocator;
|
||||
}
|
||||
} // anonymous namespace
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue