Stdatomic.h was potentially redefining _Atomic, in spite of a
prior definition by <atomic>. This could cause g++ builds that
included <stdatomic.h> with an available <atomic> header to break.
A functional stdatomic.h is a prerequisite for fixing the
following bugs. This is the middle of 3 AOSP updates to
bionics stdatomic.h that are needded to get there.
Bug:
16880454
Bug:
16513433
Change-Id: I562c7115118c0587d594d4d5b62d25101e47bfd8
(cherry picked from commit
3e4a0099a179d7acee63d78c8fc4c3cc7b0bae42)
#include <atomic>
+#undef _Atomic
+ /* Also defined by <atomic> for gcc. But not used in macros. */
+ /* Also a clang intrinsic. */
+ /* Should not be used by client code before this file is */
+ /* included. The definitions in <atomic> themselves see */
+ /* the old definition, as they should. */
+ /* Client code sees the following definition. */
#define _Atomic(t) std::atomic<t>
using std::atomic_is_lock_free;