atomics: cosmetics: Restructure ifdefs for greater clarity
Also fix the #endif comment in a few places and #include config.h to avoid assuming it is #included implicitly.
This commit is contained in:
parent
8558595a59
commit
e1b9de4fe1
@ -18,6 +18,7 @@
|
|||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
#include "atomic.h"
|
#include "atomic.h"
|
||||||
|
|
||||||
#if !HAVE_ATOMICS_NATIVE
|
#if !HAVE_ATOMICS_NATIVE
|
||||||
@ -102,7 +103,7 @@ void *avpriv_atomic_ptr_cas(void * volatile *ptr, void *oldval, void *newval)
|
|||||||
|
|
||||||
#endif /* HAVE_PTHREADS */
|
#endif /* HAVE_PTHREADS */
|
||||||
|
|
||||||
#endif /* !HAVE_MEMORYBARRIER && !HAVE_SYNC_VAL_COMPARE_AND_SWAP && !HAVE_MACHINE_RW_BARRIER */
|
#endif /* !HAVE_ATOMICS_NATIVE */
|
||||||
|
|
||||||
#ifdef TEST
|
#ifdef TEST
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
@ -23,12 +23,16 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
#if HAVE_ATOMICS_NATIVE
|
||||||
|
|
||||||
#if HAVE_ATOMICS_GCC
|
#if HAVE_ATOMICS_GCC
|
||||||
#include "atomic_gcc.h"
|
#include "atomic_gcc.h"
|
||||||
#elif HAVE_ATOMICS_WIN32
|
#elif HAVE_ATOMICS_WIN32
|
||||||
#include "atomic_win32.h"
|
#include "atomic_win32.h"
|
||||||
#elif HAVE_ATOMICS_SUNCC
|
#elif HAVE_ATOMICS_SUNCC
|
||||||
#include "atomic_suncc.h"
|
#include "atomic_suncc.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -70,5 +74,6 @@ int avpriv_atomic_int_add_and_fetch(volatile int *ptr, int inc);
|
|||||||
*/
|
*/
|
||||||
void *avpriv_atomic_ptr_cas(void * volatile *ptr, void *oldval, void *newval);
|
void *avpriv_atomic_ptr_cas(void * volatile *ptr, void *oldval, void *newval);
|
||||||
|
|
||||||
#endif /* HAVE_MEMORYBARRIER */
|
#endif /* HAVE_ATOMICS_NATIVE */
|
||||||
|
|
||||||
#endif /* AVUTIL_ATOMIC_H */
|
#endif /* AVUTIL_ATOMIC_H */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user