ndk: Fix <sys/atomics.h> declarations.

The atomic operations exported by the platform's C library do not
provide full memory barriers. This can result in incorrect results
when NDK machine code linked against them runs on multi-core devices.

While the bug has been fixed in the platform, this NDK header change
ensures that any source code that includes <sys/atomics.h> will end
up using a correct implementation of these functions, based on the
corresponding GCC builtins.

These builtins always provide a full barrier and have reasonable
performance. Application developers who depend on <sys/atomics.h>
should recompile their unmodified sources against this version
of the NDK as soon as possible.
2 files changed