[v3] updated atomic configury
Andrew MacLeod
amacleod@redhat.com
Tue Nov 22 05:20:00 GMT 2011
On 11/21/2011 11:02 PM, Andrew MacLeod wrote:
>
> Anyway, it looks like __atomic_always_lock_free doesn't fold early
> enough to be usable by the preprocessor like that even with my earlier
> version. ugg. I think I can get something defined in cpp-builtins
> that we can use. We're going to need it for C1x next release
> anyway. Should be ready to try tomorrow sometime.
>
>
Ok, try this. I've changed CPP to define a set of macros
__GCC_ATOMIC_{TYPE}_IS_LOCK_FREE
which we can use directly in the c++ header. We're going to need
something like this for C1x next release when stdatomic.h defines the
same macros.
C currently doesn't have a char16_t and char32_t, so they aren't defined
there. I defined them in the C++ header with the appropriate
HAVE_COMPARE_AND_SWAP.
this should make things work the way you were looking for, ie
#if (ATOMIC_INT_LOCK_FREE> 1)
// yes, cool, yeah!
#endif
should work just fine.
Give it a shot and see if you get what you are looking for. Ive
bootstrapped this on x86_64-unknown-linux-gnu, and didn't see any
regressions in libstdc++-v3... Im running a full bootstrap and
testsuite run overnight
Andrew
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: K
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20111122/0794bdd1/attachment.ksh>
More information about the Libstdc++
mailing list