mirror of
https://github.com/mpv-player/mpv
synced 2024-12-22 23:02:37 +00:00
vo_opengl: fall back to gcc thread local storage
gcc 4.8 does not support C11 thread local storage. This is a bit annoying, so add a hack to use the gcc specific __thread extension if C11 TLS is not available. (This is used for the extremely silly mpv-internal way hwdec modules access some platform specific handles. Disabling it simply made hwdec_vaegl.c always fail initialization.) Fixes #2631.
This commit is contained in:
parent
af958221a1
commit
1a6f3c56ea
@ -111,7 +111,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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user