Opened 9 years ago
Last modified 9 years ago
#9315 new Bugs
boost shared_ptr should detect __sync support in clang
Reported by: | Owned by: | Peter Dimov | |
---|---|---|---|
Milestone: | To Be Determined | Component: | smart_ptr |
Version: | Boost 1.54.0 | Severity: | Problem |
Keywords: | Cc: |
Description
clang (at least as of 3.4) has support for GCC sync functions. shared_ptr should properly detect that clang has such support (at least on ARM such support is not detected properly).
Change History (4)
comment:1 by , 9 years ago
Component: | None → smart_ptr |
---|---|
Owner: | set to |
comment:2 by , 9 years ago
comment:3 by , 9 years ago
As it turns out, sp_has_sync.hpp
should already detect the __sync
support because Clang defines the macro __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
. What specific problem are you having?
comment:4 by , 9 years ago
The version is the reported field is incorrect (apologies if I supplied it). This bug report was for 1.51. As you point out it's probably fixed in newer boosts.
Note:
See TracTickets
for help on using tickets.
Most versions of clang appear to provide a working
<atomic>
, so we'll probably use that instead of the obsolete!__sync
intrinsics.https://github.com/boostorg/smart_ptr/commit/fed15ad8c50921cbfc0365156e4e4f4454dc1b91 allows you to turn
std::atomic
support on manually by#define BOOST_SP_USE_STD_ATOMIC
. This will eventually become the default whenstd::atomic
is autodetected to be present.