diff --git a/include/boost/config/compiler/clang.hpp b/include/boost/config/compiler/clang.hpp index 9d8ba7d71..4ef36a3e2 100644 --- a/include/boost/config/compiler/clang.hpp +++ b/include/boost/config/compiler/clang.hpp @@ -351,3 +351,11 @@ // Macro used to identify the Clang compiler. #define BOOST_CLANG 1 +#if (__clang_major__ >= 4 || (__clang_major__ >= 3 && __clang_minor__ >= 8)) +# define BOOST_ATTRIBUTE_TARGET(isa) __attribute__ ((target(isa))) +#endif + +#if defined(__clang__) && !defined(_MSC_VER) +# define BOOST_ATTRIBUTE_MALLOC_FUNCTION __attribute__ ((malloc)) +#endif + diff --git a/include/boost/config/compiler/gcc.hpp b/include/boost/config/compiler/gcc.hpp index da1a43229..1af756c80 100644 --- a/include/boost/config/compiler/gcc.hpp +++ b/include/boost/config/compiler/gcc.hpp @@ -242,7 +242,7 @@ // C++0x features in 4.7.n and later // #if (BOOST_GCC_VERSION < 40700) || !defined(BOOST_GCC_CXX11) -// Note that while constexpr is partly supported in gcc-4.6 it's a +// Note that while constexpr is partly supported in gcc-4.6 it's a // pre-std version with several bugs: # define BOOST_NO_CXX11_CONSTEXPR # define BOOST_NO_CXX11_FINAL @@ -373,3 +373,9 @@ # endif #endif +#if (BOOST_GCC_VERSION >= 40800) +# define BOOST_ATTRIBUTE_TARGET(isa) __attribute__ ((target(isa))) +#endif + +#define BOOST_ATTRIBUTE_MALLOC_FUNCTION __attribute__ ((malloc)) + diff --git a/include/boost/config/compiler/visualc.hpp b/include/boost/config/compiler/visualc.hpp index 7335540db..c2e3d14b8 100644 --- a/include/boost/config/compiler/visualc.hpp +++ b/include/boost/config/compiler/visualc.hpp @@ -365,3 +365,8 @@ // BOOST_PRAGMA_MESSAGE("Info: Boost.Config is older than your compiler version - probably nothing bad will happen - but you may wish to look for an updated Boost version. Define BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE to suppress this message.") # endif #endif + + +#if defined(_MSC_VER) +# define BOOST_ATTRIBUTE_MALLOC_FUNCTION __declspec(restrict) +#endif