boostorg / lockfree

Boost.Lockfree
125 stars 86 forks source link

Switch to BOOST_NO_CXX11_HDR_ATOMIC ? #17

Closed htfy96 closed 8 years ago

htfy96 commented 8 years ago

The existence of <atomic> not only depends on the version of compiler, but also the version of standard library.

When detail/atomic.hpp was created in this project, there was no BOOST_NO_CXX11_HDR_ATOMIC (which was introduced around Sep, 2014?) in boost::config. Now BOOST_NO_CXX11_HDR_ATOMIC has been well tested and covers far more compilers than BOOST_LOCKFREE_NO_HDR_ATOMIC. So I think it's time to switch to BOOST_NO_CXX11_HDR_ATOMIC .

timblechmann commented 8 years ago

BOOST_NO_CXX11_HDR_ATOMIC doesn't help: some clang versions provided <atomic>, but the implementation was broken, so it couldn't be used. BOOST_NO_CXX11_HDR_ATOMIC only tells that the header is there, but not that the implementation is valid

htfy96 commented 8 years ago

This one is stricter than currrent version:

#include <boost/config.hpp>
#if defined(BOOST_NO_CXX11_HDR_ATOMIC) && !defined(BOOST_LOCKFREE_NO_HDR_ATOMIC)
#  define BOOST_LOCKFREE_NO_HDR_ATOMIC
#endif
timblechmann commented 8 years ago

could you send me a pull request?