Files
mpv/osdep/threads.h
T
NRK b09e06a920 osdep/threads: prefer using thread_local
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.
2025-04-06 17:01:33 +02:00

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