mirror of
https://github.com/mpv-player/mpv
synced 2024-10-02 16:25:33 +02:00
atomics: cleanup HAVE_ATOMICS define
The waf build system generates this already. No point in redoing it in the header file. The legacy build system (which we really should drop) didn't; fix it.
This commit is contained in:
parent
baeead7181
commit
70c990cda5
@ -514,9 +514,12 @@ check_statement_libs "compiler support for __sync built-ins" $_sync SYNC_BUILTIN
|
|||||||
stdint.h 'int64_t test = 0; test = __sync_add_and_fetch(&test, 1)'
|
stdint.h 'int64_t test = 0; test = __sync_add_and_fetch(&test, 1)'
|
||||||
_sync=$(defretval)
|
_sync=$(defretval)
|
||||||
|
|
||||||
|
_any_atomic=yes
|
||||||
if test "$_atomic" = no && test "$_sync" = no && test "$_stdatomic" = no ; then
|
if test "$_atomic" = no && test "$_sync" = no && test "$_stdatomic" = no ; then
|
||||||
echo "your compiler must support either stdatomic.h, or __atomic, or __sync built-ins."
|
echo "your compiler must support either stdatomic.h, or __atomic, or __sync built-ins."
|
||||||
|
_any_atomic=no
|
||||||
fi
|
fi
|
||||||
|
define_yes_no $_any_atomic HAVE_ATOMICS
|
||||||
|
|
||||||
check_compile "iconv" $_iconv ICONV waftools/fragments/iconv.c " " "-liconv" "-liconv $_ld_dl"
|
check_compile "iconv" $_iconv ICONV waftools/fragments/iconv.c " " "-liconv" "-liconv $_ld_dl"
|
||||||
_iconv=$(defretval)
|
_iconv=$(defretval)
|
||||||
|
@ -22,8 +22,6 @@
|
|||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#define HAVE_ATOMICS 1
|
|
||||||
|
|
||||||
#if HAVE_STDATOMIC
|
#if HAVE_STDATOMIC
|
||||||
#include <stdatomic.h>
|
#include <stdatomic.h>
|
||||||
#else
|
#else
|
||||||
@ -97,9 +95,6 @@ typedef struct { volatile unsigned long long v, t; } atomic_ullong;
|
|||||||
#define atomic_compare_exchange_strong(p, old, new) \
|
#define atomic_compare_exchange_strong(p, old, new) \
|
||||||
((p)->v == *(old) ? ((p)->v = (new), 1) : (*(old) = (p)->v, 0))
|
((p)->v == *(old) ? ((p)->v = (new), 1) : (*(old) = (p)->v, 0))
|
||||||
|
|
||||||
#undef HAVE_ATOMICS
|
|
||||||
#define HAVE_ATOMICS 0
|
|
||||||
|
|
||||||
#endif /* no atomics */
|
#endif /* no atomics */
|
||||||
|
|
||||||
#endif /* else HAVE_STDATOMIC */
|
#endif /* else HAVE_STDATOMIC */
|
||||||
|
Loading…
Reference in New Issue
Block a user