|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r63369 - trunk/boost/typeof
From: peder.holt_at_[hidden]
Date: 2010-06-26 16:28:53
Author: burbelgruff
Date: 2010-06-26 16:28:49 EDT (Sat, 26 Jun 2010)
New Revision: 63369
URL: http://svn.boost.org/trac/boost/changeset/63369
Log:
Allow inclusion of typeof.hpp for compilers (borland) that does not support typeof emulation or native typeof. For these compilers, BOOST_TYPEOF_EMULATION_UNSUPPORTED will be defined, and BOOST_TYPEOF(Expr) will always result in boost::type_of::typeof_emulation_is_unsupported_on_this_compiler
Added:
trunk/boost/typeof/unsupported.hpp (contents, props changed)
Text files modified:
trunk/boost/typeof/typeof.hpp | 23 ++++++++++++++++++++---
1 files changed, 20 insertions(+), 3 deletions(-)
Modified: trunk/boost/typeof/typeof.hpp
==============================================================================
--- trunk/boost/typeof/typeof.hpp (original)
+++ trunk/boost/typeof/typeof.hpp 2010-06-26 16:28:49 EDT (Sat, 26 Jun 2010)
@@ -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()\
<boost/typeof/incr_registration_group.hpp>
-#ifdef BOOST_TYPEOF_EMULATION
+#ifdef BOOST_TYPEOF_EMULATION_UNSUPPORTED
+# include <boost/typeof/unsupported.hpp>
+#elif defined BOOST_TYPEOF_EMULATION
# define BOOST_TYPEOF_TEXT "using typeof emulation"
# include <boost/typeof/message.hpp>
# include <boost/typeof/typeof_impl.hpp>
Added: trunk/boost/typeof/unsupported.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/typeof/unsupported.hpp 2010-06-26 16:28:49 EDT (Sat, 26 Jun 2010)
@@ -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
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk