You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/media-video/mpv/files/mpv-0.14.0-support-GNU-__th...

38 lines
1.1 KiB

For a lengthy discussion see https://github.com/mpv-player/mpv/issues/2631
Upstream commits:
https://github.com/mpv-player/mpv/commit/1a6f3c56ea6e7bf9928fc99469f8f5da4578f035
https://github.com/mpv-player/mpv/commit/946bd52a1d1eb561ff8bb516ef6efcd02ca3ea1e
diff --git a/video/out/opengl/common.c b/video/out/opengl/common.c
index 00cd535..f607c23 100644
--- a/video/out/opengl/common.c
+++ b/video/out/opengl/common.c
@@ -606,7 +606,13 @@ int mpgl_validate_backend_opt(struct mp_log *log, const struct m_option *opt,
}
#if HAVE_C11_TLS
-static _Thread_local MPGLContext *current_context;
+#define MP_TLS _Thread_local
+#elif defined(__GNU__)
+#define MP_TLS __thread
+#endif
+
+#ifdef MP_TLS
+static MP_TLS MPGLContext *current_context;
static void * GLAPIENTRY get_native_display(const char *name)
{
diff --git a/wscript b/wscript
index a5e6914..969d9cc 100644
--- a/wscript
+++ b/wscript
@@ -718,7 +718,6 @@ video_output_features = [
}, {
'name': 'vaapi-egl',
'desc': 'VAAPI EGL',
- 'deps': [ 'c11-tls' ], # indirectly
'deps_any': [ 'vaapi-x-egl', 'vaapi-wayland' ],
'func': check_true,
}, {