clang support for __sync_* intrinsics

Does anyone know what is the earlier version of Clang that supports the __sync_* intrinsics?

On Fri, Feb 28, 2014 at 8:00 PM, Peter Dimov
Does anyone know what is the earlier version of Clang that supports the __sync_* intrinsics?
I don't know what was the earliest one but you could use __has_builtin macro to check for its presence. You can also use __GCC_HAVE_SYNC_COMPARE_AND_SWAP_N macros (where N is the size of the arguments) which are defined when __sync_compare_and_swap is supported in hardware.

Andrey Semashev wrote:
On Fri, Feb 28, 2014 at 8:00 PM, Peter Dimov
wrote: Does anyone know what is the earlier version of Clang that supports the __sync_* intrinsics?
I don't know what was the earliest one but you could use __has_builtin macro to check for its presence.
Yes, I figured that out slightly after I sent the mail. Version checks are not the Clang way and are a symptom of an outdated mentality. :-)
You can also use __GCC_HAVE_SYNC_COMPARE_AND_SWAP_N macros...
Interestingly, it turns out that I already do that. The problem prompting https://svn.boost.org/trac/boost/ticket/9315 is probably that an earlier #ifdef path is taken instead.
participants (2)
-
Andrey Semashev
-
Peter Dimov