Mesa (main): glapi: Never use dllimport/dllexport for TLS vars on Windows

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Dec 13 17:34:16 UTC 2021


Module: Mesa
Branch: main
Commit: 36425c43c956e6eb22be8b4ef147666285bc8e51
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=36425c43c956e6eb22be8b4ef147666285bc8e51

Author: Jesse Natalie <jenatali at microsoft.com>
Date:   Fri Dec 10 16:54:08 2021 -0800

glapi: Never use dllimport/dllexport for TLS vars on Windows

Fixes: c691149f ("win32: Fixes thread local on win32 with clang/mingw")
Reviewed-by: Yonggang Luo <luoyonggang at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14162>

---

 src/mapi/glapi/glapi.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mapi/glapi/glapi.h b/src/mapi/glapi/glapi.h
index 8842dad851f..60be92a1cd8 100644
--- a/src/mapi/glapi/glapi.h
+++ b/src/mapi/glapi/glapi.h
@@ -46,6 +46,7 @@
 
 #include "util/macros.h"
 #include "util/u_thread.h"
+#include "util/detect_os.h"
 
 
 #ifdef __cplusplus
@@ -79,7 +80,7 @@ struct _glapi_table;
 
 #if defined (USE_ELF_TLS)
 
-#if defined(USE_TLS_BEHIND_FUNCTIONS)
+#if DETECT_OS_WINDOWS
 extern __THREAD_INITIAL_EXEC struct _glapi_table * _glapi_tls_Dispatch;
 extern __THREAD_INITIAL_EXEC void * _glapi_tls_Context;
 #else



More information about the mesa-commit mailing list