stdatomic.h: Add new header file.
This adds a modified version of the FreeBSD version of stdatomic.h
that can be used with our prebuilt GCC 4.6 linux host toolchain.
Modifications include:
- Removal of __has_feature() macros because they cause some
strange CPP parsing errors (even if you define __has_feature(x) to 0 ?)
- Manual definition of ATOMIC_XXX_LOCK_FREE macros since
__GCC_ATOMIC_XXX_LOCK_FREE isn't available until at least 4.8
- ATOMIC_VAR_INIT(val) is defined as '{ (value) }' instead of
'{ .__val = (value) }' since the latter doesn't compile when
using in bionic/tests/stdatomic_test.cpp
- Remove __unused macro usage.
- Definition of atomic_compare_exchange_string_explicit() macro
was modified to avoid compiler errors.
- __has_builtin(__sync_swap) doesn't parse with GCC 4.6, so
replace it with a GCC version check (>= 4.7)
Change-Id: Iadacace883ce43797e2dbc4d1bd3d39bb02c438e
NOTE: This is _not_ meant to be used with other versions of GCC
1 file changed