Support gcc47 atomics

yep. Exactly what it says.
Add a couple of leading _ to avoid potential collisions?
Should this be static inline?