1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-26 17:12:36 +00:00

build: make C11 atomics mandatory

The emulation is pretty bad, and C11 compilers are everywhere now. It's
time to retire the emulation, which was always meant as temporary hack
for transition.

In theory, a user can still use --disable-stdatomic to enable the
emulation code, but that's sort of hidden. Actual support will be
removed after the next release or so.
This commit is contained in:
wm4 2020-03-12 12:52:51 +01:00
parent 5105a3b05a
commit 06718da79c

19
wscript
View File

@ -206,27 +206,19 @@ main_dependencies = [
'req': True,
'fmsg': 'Unable to find pthreads support.'
}, {
'name': 'gnuc',
'desc': 'GNU C extensions',
'func': check_statement([], "__GNUC__"),
}, {
'name': 'stdatomic',
'desc': 'stdatomic.h',
'name': '--stdatomic',
'desc': 'C11 stdatomic.h',
'func': check_libs(['atomic'],
check_statement('stdatomic.h',
'atomic_int_least64_t test = ATOMIC_VAR_INIT(123);'
'atomic_fetch_add(&test, 1)'))
'atomic_fetch_add(&test, 1)')),
'req': True,
'fmsg': 'C11 atomics are required; you may need a newer compiler',
}, {
# C11; technically we require C11, but aligned_alloc() is not in MinGW
'name': 'aligned_alloc',
'desc': 'C11 aligned_alloc()',
'func': check_statement('stdlib.h', 'aligned_alloc(1, 1)'),
}, {
'name': 'atomics',
'desc': 'stdatomic.h support or slow emulation',
'func': check_true,
'req': True,
'deps': 'stdatomic || gnuc',
}, {
'name': 'librt',
'desc': 'linking with -lrt',
@ -500,7 +492,6 @@ audio_output_features = [
}, {
'name': '--audiounit',
'desc': 'AudioUnit output for iOS',
'deps': 'atomics',
'func': check_cc(
fragment=load_fragment('audiounit.c'),
framework_name=['Foundation', 'AudioToolbox'])