Skip to content

Commit

Permalink
build: make C11 atomics mandatory
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
wm4 committed Mar 13, 2020
1 parent 5105a3b commit 06718da
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions wscript
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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'])
Expand Down

0 comments on commit 06718da

Please sign in to comment.