From c6b7a4dacee3067ad00abdb3abf71c7e8eb62e78 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 6 Sep 2016 20:13:30 +0200 Subject: atomics: readd some emulation This time it's emulation that's supposed to work (not just dummied out). Unlike the previous emulation, no mpv code has to be disabled, and everything should work (albeit possibly a bit slowly). On the other hand, it's not possible to implement this kind of emulation without compiler support. We use GNU statement expressions and __typeof__ in this case. This code is inactive if stdatomic.h is available. --- wscript | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'wscript') diff --git a/wscript b/wscript index 5553b23c72..7eed072bb6 100644 --- a/wscript +++ b/wscript @@ -148,6 +148,10 @@ main_dependencies = [ 'func': check_pthreads, 'req': True, 'fmsg': 'Unable to find pthreads support.' + }, { + 'name': 'gnuc', + 'desc': 'GNU C extensions', + 'func': check_statement([], "__GNUC__"), }, { 'name': 'stdatomic', 'desc': 'stdatomic.h', @@ -173,10 +177,10 @@ main_dependencies = [ 'deps_neg': [ 'stdatomic', 'atomic-builtins' ], }, { 'name': 'atomics', - 'desc': 'compiler support for usable thread synchronization built-ins', + 'desc': 'stdatomic.h support or emulation', 'func': check_true, 'req': True, - 'deps_any': ['stdatomic', 'atomic-builtins', 'sync-builtins'], + 'deps_any': ['stdatomic', 'atomic-builtins', 'sync-builtins', 'gnuc'], }, { 'name': 'c11-tls', 'desc': 'C11 TLS support', -- cgit v1.2.3