diff options
Diffstat (limited to 'boost/typeof/typeof.hpp')
-rw-r--r-- | boost/typeof/typeof.hpp | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/boost/typeof/typeof.hpp b/boost/typeof/typeof.hpp index 4d56964980..1efa3dc8c4 100644 --- a/boost/typeof/typeof.hpp +++ b/boost/typeof/typeof.hpp @@ -13,7 +13,15 @@ # error both typeof emulation and native mode requested #endif -#if defined(__COMO__) +#include <boost/config.hpp> + +#if !defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) && !defined(BOOST_TYPEOF_EMULATION) +# define BOOST_TYPEOF_DECLTYPE +# ifndef BOOST_TYPEOF_NATIVE +# define BOOST_TYPEOF_NATIVE +# endif + +#elif defined(__COMO__) # ifdef __GNUG__ # ifndef BOOST_TYPEOF_EMULATION # ifndef BOOST_TYPEOF_NATIVE @@ -49,7 +57,7 @@ # endif # endif -#elif defined(__GNUC__) +#elif defined(__GNUC__) || defined(__clang__) # ifndef BOOST_TYPEOF_EMULATION # ifndef BOOST_TYPEOF_NATIVE # define BOOST_TYPEOF_NATIVE @@ -100,17 +108,7 @@ # define MSVC_TYPEOF_HACK # endif #elif defined(_MSC_VER) -# if (_MSC_VER <= 1300) // 6.5, 7.0 -# ifndef BOOST_TYPEOF_EMULATION -# ifndef BOOST_TYPEOF_NATIVE -# define BOOST_TYPEOF_NATIVE -# endif -# include <boost/typeof/msvc/typeof_impl.hpp> -# define MSVC_TYPEOF_HACK -# else -# error typeof emulation is not supported -# endif -# elif (_MSC_VER >= 1310) // 7.1 -> +# if (_MSC_VER >= 1310) // 7.1 -> # ifndef BOOST_TYPEOF_EMULATION # ifndef BOOST_TYPEOF_NATIVE # ifndef _MSC_EXTENSIONS @@ -171,6 +169,13 @@ # define BOOST_TYPEOF_KEYWORD __typeof__ # endif # endif +#elif defined(__IBM__TYPEOF__) +# ifndef BOOST_TYPEOF_EMULATION +# ifndef BOOST_TYPEOF_NATIVE +# define BOOST_TYPEOF_NATIVE +# endif +# define BOOST_TYPEOF_KEYWORD __typeof__ +# endif #else //unknown compiler # ifndef BOOST_TYPEOF_NATIVE # ifndef BOOST_TYPEOF_EMULATION @@ -206,7 +211,11 @@ #elif defined(BOOST_TYPEOF_NATIVE) # define BOOST_TYPEOF_TEXT "using native typeof" # include <boost/typeof/message.hpp> -# include <boost/typeof/native.hpp> +# ifdef BOOST_TYPEOF_DECLTYPE +# include <boost/typeof/decltype.hpp> +# else +# include <boost/typeof/native.hpp> +# endif #else # error typeof configuration error #endif |