From b7dba02b73e24134b209ef4ed30a9fdfdbccea0a Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Thu, 25 May 2017 12:54:34 +0300 Subject: [PATCH] In addition to compiler checks for may_alias support, use __has_attribute as well. --- include/boost/atomic/detail/config.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/boost/atomic/detail/config.hpp b/include/boost/atomic/detail/config.hpp index eb82032..efba5ae 100644 --- a/include/boost/atomic/detail/config.hpp +++ b/include/boost/atomic/detail/config.hpp @@ -80,7 +80,8 @@ #endif #endif // defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) -#if defined(__GNUC__) && (!defined(BOOST_INTEL_CXX_VERSION) || (BOOST_INTEL_CXX_VERSION+0) >= 1300) +#if (defined(__GNUC__) && (!defined(BOOST_INTEL_CXX_VERSION) || (BOOST_INTEL_CXX_VERSION+0) >= 1300)) ||\ + (defined(__has_attribute) && (__has_attribute(may_alias)+0) != 0) #define BOOST_ATOMIC_DETAIL_MAY_ALIAS __attribute__((__may_alias__)) #define BOOST_ATOMIC_DETAIL_STORAGE_MAY_ALIAS #elif defined(BOOST_MSVC)