diff --git a/include/boost/typeof/typeof.hpp b/include/boost/typeof/typeof.hpp old mode 100755 new mode 100644 index 165ef95..a9d2fea --- a/include/boost/typeof/typeof.hpp +++ b/include/boost/typeof/typeof.hpp @@ -65,7 +65,7 @@ # endif # define BOOST_TYPEOF_KEYWORD __typeof__ # else -# error typeof emulation is not supported +# define BOOST_TYPEOF_EMULATION_UNSUPPORTED # endif # else // 9.x # ifndef BOOST_TYPEOF_EMULATION @@ -75,7 +75,22 @@ # define BOOST_TYPEOF_KEYWORD __typeof__ # endif # endif - +#elif defined __CODEGEARC__ +# ifndef BOOST_TYPEOF_EMULATION +# ifndef BOOST_TYPEOF_NATIVE +# define BOOST_TYPEOF_EMULATION_UNSUPPORTED +# endif +# else +# define BOOST_TYPEOF_EMULATION_UNSUPPORTED +# endif +#elif defined __BORLANDC__ +# ifndef BOOST_TYPEOF_EMULATION +# ifndef BOOST_TYPEOF_NATIVE +# define BOOST_TYPEOF_EMULATION_UNSUPPORTED +# endif +# else +# define BOOST_TYPEOF_EMULATION_UNSUPPORTED +# endif #elif defined __DMC__ # ifndef BOOST_TYPEOF_EMULATION # ifndef BOOST_TYPEOF_NATIVE @@ -163,7 +178,9 @@ #define BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()\ -#ifdef BOOST_TYPEOF_EMULATION +#ifdef BOOST_TYPEOF_EMULATION_UNSUPPORTED +# include +#elif defined BOOST_TYPEOF_EMULATION # define BOOST_TYPEOF_TEXT "using typeof emulation" # include # include diff --git a/include/boost/typeof/unsupported.hpp b/include/boost/typeof/unsupported.hpp new file mode 100644 index 0000000..83d3a55 --- /dev/null +++ b/include/boost/typeof/unsupported.hpp @@ -0,0 +1,29 @@ +// Copyright (C) 2010 Peder Holt +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_TYPEOF_UNSUPPORTED_HPP_INCLUDED +#define BOOST_TYPEOF_UNSUPPORTED_HPP_INCLUDED + +namespace boost { namespace type_of { + struct typeof_emulation_is_unsupported_on_this_compiler {}; +}} + +#define BOOST_TYPEOF(expr) boost::type_of::typeof_emulation_is_unsupported_on_this_compiler +#define BOOST_TYPEOF_TPL BOOST_TYPEOF + +#define BOOST_TYPEOF_NESTED_TYPEDEF_TPL(name,expr) \ +struct name {\ + typedef BOOST_TYPEOF_TPL(expr) type;\ +}; + +#define BOOST_TYPEOF_NESTED_TYPEDEF(name,expr) \ +struct name {\ + typedef BOOST_TYPEOF(expr) type;\ +}; + + +#define BOOST_TYPEOF_REGISTER_TYPE(x) +#define BOOST_TYPEOF_REGISTER_TEMPLATE(x, params) + +#endif \ No newline at end of file