This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [v3] updated atomic configury


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

Attachment: K
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]