<div class="gmail_quote">2011/9/25 Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com" target="_blank">eli.friedman@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><div></div><div>On Sun, Sep 25, 2011 at 12:04 PM, Ruben Van Boxem<br>
<<a href="mailto:vanboxem.ruben@gmail.com" target="_blank">vanboxem.ruben@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> What is the status/usability of Clang's builtin atomic functions, especially<br>
> on Windows? Are the builtins related to the availability of pthreads or not?<br>
><br>
> It seems libc++ uses these builtins, but for *-*-mingw*, they're undeclared<br>
> :(<br>
><br>
> Can Clang "tap into" the GCC implementations?<br>
<br>
</div></div>Please clarify what exactly you are talking about... which builtins, exactly?<br></blockquote><div><br>Things documented/proposed? here:<br><a href="http://libcxx.llvm.org/atomic_design_a.html">http://libcxx.llvm.org/atomic_design_a.html</a><br>
or <a href="http://libcxx.llvm.org/atomic_design_b.html">http://libcxx.llvm.org/atomic_design_b.html</a><br>or <a href="http://libcxx.llvm.org/atomic_design_c.html">http://libcxx.llvm.org/atomic_design_c.html</a><br>GCC has __sync_* documented here: <a href="http://gcc.gnu.org/onlinedocs/gcc/Atomic-Builtins.html">http://gcc.gnu.org/onlinedocs/gcc/Atomic-Builtins.html</a><br>
<br>I don't know if libc++ <atomic> is meant to be usable yet (I would think it is), but the __has_feature(cxx_atomic) is false for my Clang build. I do know someone did some work in this regard for Clang. The only discussion on this topic I can find right now is dated almost a year ago:<br>
<a href="http://clang-developers.42468.n3.nabble.com/atomic-intrinsics-td1618127i20.html">http://clang-developers.42468.n3.nabble.com/atomic-intrinsics-td1618127i20.html</a><br><br>Ruben<br><br>PS: if <atomic> is not meant to be used right now, I'll ignore it completely.<br>

</div></div>