diff options
Diffstat (limited to 'boost/config/compiler/clang.hpp')
-rw-r--r-- | boost/config/compiler/clang.hpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/boost/config/compiler/clang.hpp b/boost/config/compiler/clang.hpp index 47ea65b0a2..5481e5ee62 100644 --- a/boost/config/compiler/clang.hpp +++ b/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 @@ -58,9 +62,11 @@ // even though it defines __SIZEOF_INT128__. // See https://svn.boost.org/trac/boost/ticket/10418 // Only re-enable this for nvcc if you're absolutely sure -// of the circumstances under which it's supported: +// of the circumstances under which it's supported. +// Similarly __SIZEOF_INT128__ is defined when targetting msvc +// compatibility even though the required support functions are absent. // -#if defined(__SIZEOF_INT128__) && !defined(__CUDACC__) +#if defined(__SIZEOF_INT128__) && !defined(__CUDACC__) && !defined(_MSC_VER) # define BOOST_HAS_INT128 #endif @@ -255,13 +261,15 @@ // All versions with __cplusplus above this value seem to support this: # define BOOST_NO_CXX14_DIGIT_SEPARATORS #endif - - -// Unused attribute: -#if defined(__GNUC__) && (__GNUC__ >= 4) -# define BOOST_ATTRIBUTE_UNUSED __attribute__((unused)) +// +// __builtin_unreachable: +#if defined(__has_builtin) && __has_builtin(__builtin_unreachable) +#define BOOST_UNREACHABLE_RETURN(x) __builtin_unreachable(); #endif +// Clang has supported the 'unused' attribute since the first release. +#define BOOST_ATTRIBUTE_UNUSED __attribute__((__unused__)) + #ifndef BOOST_COMPILER # define BOOST_COMPILER "Clang version " __clang_version__ #endif |