win32: Fixes thread local on win32 with clang/mingw (!14062)

The mingw compiling error:
```
../../src/mapi/glapi/glapi.h:86:66: error: '_glapi_tls_Dispatch' cannot be thread local when declared 'dllimport'
_GLAPI_EXPORT extern __THREAD_INITIAL_EXEC struct _glapi_table * _glapi_tls_Dispatch;
                                                                 ^
../../src/mapi/glapi/glapi.h:88:51: error: '_glapi_tls_Context' cannot be thread local when declared 'dllimport'
_GLAPI_EXPORT extern __THREAD_INITIAL_EXEC void * _glapi_tls_Context;
```

Fixes: c47fd3dc ("windows: Use TLS context/dispatch with shared-glapi")

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14062>
This commit is contained in:
Yonggang Luo 2021-12-04 17:39:09 +08:00 committed by Marge Bot
parent 9626595026
commit c691149f3e
1 changed files with 3 additions and 4 deletions

View File

@ -79,12 +79,11 @@ struct _glapi_table;
#if defined (USE_ELF_TLS)
#ifdef _MSC_VER
extern __declspec(thread) struct _glapi_table * _glapi_tls_Dispatch;
extern __declspec(thread) void * _glapi_tls_Context;
#if defined(USE_TLS_BEHIND_FUNCTIONS)
extern __THREAD_INITIAL_EXEC struct _glapi_table * _glapi_tls_Dispatch;
extern __THREAD_INITIAL_EXEC void * _glapi_tls_Context;
#else
_GLAPI_EXPORT extern __THREAD_INITIAL_EXEC struct _glapi_table * _glapi_tls_Dispatch;
_GLAPI_EXPORT extern __THREAD_INITIAL_EXEC void * _glapi_tls_Context;
#endif