xoreos  0.0.5
atomic.h File Reference

Helper header to include boost::atomic. More...

#include <boost/atomic.hpp>
Include dependency graph for atomic.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Detailed Description

Helper header to include boost::atomic.

boost/atomic.hpp typedefs atomic<intptr_t> and atomic<uintptr_t>, but doesn't include stdint.h on purpose when compiling with gcc, only unistd.h. Unfortunately, unistd.h in glibc 2.19 only defines intptr_t and not uintptr_t, breaking compilation.

To fix this issue, we manually include both unistd.h and stdint.h (in that order), if they're available.

This strict order requirement of unistd.h and stdint.h also means that this header needs to be included relatively early, ideally at the top.

Definition in file atomic.h.