From 034817c492923a05181d5ad745ccaa8578feb1b0 Mon Sep 17 00:00:00 2001 From: Nicolas Cornu Date: Thu, 27 Aug 2015 13:34:22 +0200 Subject: [PATCH] Use __has_attribute instead of gcc version in clang --- include/boost/config/compiler/clang.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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