diff --git a/include/boost/config/compiler/clang.hpp b/include/boost/config/compiler/clang.hpp index 47ea65b0..c78edb24 100644 --- a/include/boost/config/compiler/clang.hpp +++ b/include/boost/config/compiler/clang.hpp @@ -23,6 +23,10 @@ #define __has_extension __has_feature #endif +#ifndef __has_attribute +#define __has_attribute(x) 0 +#endif + #if !__has_feature(cxx_exceptions) && !defined(BOOST_NO_EXCEPTIONS) # define BOOST_NO_EXCEPTIONS #endif @@ -256,9 +260,7 @@ # define BOOST_NO_CXX14_DIGIT_SEPARATORS #endif - -// Unused attribute: -#if defined(__GNUC__) && (__GNUC__ >= 4) +#if __has_attribute(unused) # define BOOST_ATTRIBUTE_UNUSED __attribute__((unused)) #endif