mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
ao: simplify hack for float atomics
stdatomic.h defines no atomic_float typedef. We can't just use _Atomic unconditionally, because we support compilers without C11 atomics. So just create a custom atomic_float typedef in the wrapper, which uses _Atomic in the C11 code path.
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
|
||||
#if HAVE_STDATOMIC
|
||||
#include <stdatomic.h>
|
||||
typedef _Atomic float mp_atomic_float;
|
||||
#else
|
||||
|
||||
// Emulate the parts of C11 stdatomic.h needed by mpv.
|
||||
@@ -36,6 +37,8 @@ typedef struct { long long v; } atomic_llong;
|
||||
typedef struct { uint_least32_t v; } atomic_uint_least32_t;
|
||||
typedef struct { unsigned long long v; } atomic_ullong;
|
||||
|
||||
typedef struct { float v; } mp_atomic_float;
|
||||
|
||||
#define ATOMIC_VAR_INIT(x) \
|
||||
{.v = (x)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user