mirror of
https://github.com/mpv-player/mpv.git
synced 2026-06-06 20:10:30 +00:00
C11 uses _Thread_local as the keyword, which thread_local macro is defined to (inside of <threads.h>, which mpv doesn't use): https://port70.net/~nsz/c/c11/n1570.html#7.26.1p3 C23 promotes thread_local to a keyword and marks _Thread_local as obsolete and to be avoided in new code: https://www.iso-9899.info/n3220.html#6.4.1p3 so just use thread_local directly, which is future-proof while having a fallback define in osdep/threads.h for pre-C23 cases.
15 lines
226 B
C
15 lines
226 B
C
#ifndef MP_OSDEP_THREADS_H_
|
|
#define MP_OSDEP_THREADS_H_
|
|
|
|
#include "config.h"
|
|
|
|
#if HAVE_WIN32_THREADS
|
|
#include "threads-win32.h"
|
|
#else
|
|
#include "threads-posix.h"
|
|
#endif
|
|
|
|
#include "osdep/compiler.h" // for thread_local
|
|
|
|
#endif
|