Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r79920 - in trunk/boost/proto: . transform transform/detail
From: eric_at_[hidden]
Date: 2012-08-08 03:01:39


Author: eric_niebler
Date: 2012-08-08 03:01:36 EDT (Wed, 08 Aug 2012)
New Revision: 79920
URL: http://svn.boost.org/trac/boost/changeset/79920

Log:
workarounds for earlier gcc flavors
Text files modified:
   trunk/boost/proto/traits.hpp | 2 +-
   trunk/boost/proto/transform/detail/make_gcc_workaround.hpp | 4 ++--
   trunk/boost/proto/transform/env.hpp | 24 ++++++++++++++++++++++--
   trunk/boost/proto/transform/make.hpp | 2 +-
   4 files changed, 26 insertions(+), 6 deletions(-)

Modified: trunk/boost/proto/traits.hpp
==============================================================================
--- trunk/boost/proto/traits.hpp (original)
+++ trunk/boost/proto/traits.hpp 2012-08-08 03:01:36 EDT (Wed, 08 Aug 2012)
@@ -116,7 +116,7 @@
       : mpl::false_
     {};
 
- #if BOOST_WORKAROUND(__GNUC__, == 3) || (__GNUC__ == 4 && __GNUC_MINOR__ == 0)
+ #if BOOST_WORKAROUND(__GNUC__, == 3) || (BOOST_WORKAROUND(__GNUC__, == 4) && __GNUC_MINOR__ == 0)
     // work around GCC bug
     template<typename Tag, typename Args, long N>
     struct is_callable<proto::expr<Tag, Args, N> >

Modified: trunk/boost/proto/transform/detail/make_gcc_workaround.hpp
==============================================================================
--- trunk/boost/proto/transform/detail/make_gcc_workaround.hpp (original)
+++ trunk/boost/proto/transform/detail/make_gcc_workaround.hpp 2012-08-08 03:01:36 EDT (Wed, 08 Aug 2012)
@@ -1,6 +1,6 @@
 #if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
 
- #if BOOST_WORKAROUND(__GNUC__, == 3) || (__GNUC__ == 4 && __GNUC_MINOR__ == 0)
+ #if BOOST_WORKAROUND(__GNUC__, == 3) || (BOOST_WORKAROUND(__GNUC__, == 4) && __GNUC_MINOR__ == 0)
         #include <boost/proto/transform/detail/preprocessed/make_gcc_workaround.hpp>
     #endif
 
@@ -29,7 +29,7 @@
         #pragma wave option(preserve: 1)
     #endif
 
- #if BOOST_WORKAROUND(__GNUC__, == 3) || (__GNUC__ == 4 && __GNUC_MINOR__ == 0) || \
+ #if BOOST_WORKAROUND(__GNUC__, == 3) || (BOOST_WORKAROUND(__GNUC__, == 4) && __GNUC_MINOR__ == 0) || \
         (defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES))
 
         #define BOOST_PP_ITERATION_PARAMS_1 \

Modified: trunk/boost/proto/transform/env.hpp
==============================================================================
--- trunk/boost/proto/transform/env.hpp (original)
+++ trunk/boost/proto/transform/env.hpp 2012-08-08 03:01:36 EDT (Wed, 08 Aug 2012)
@@ -9,6 +9,8 @@
 #ifndef BOOST_PROTO_TRANSFORM_ENV_HPP_EAN_18_07_2012
 #define BOOST_PROTO_TRANSFORM_ENV_HPP_EAN_18_07_2012
 
+#include <boost/config.hpp>
+#include <boost/detail/workaround.hpp>
 #include <boost/ref.hpp>
 #include <boost/utility/enable_if.hpp>
 #include <boost/type_traits/is_const.hpp>
@@ -110,10 +112,27 @@
                   , value_(value)
                 {}
 
+ #if BOOST_WORKAROUND(__GNUC__, == 3) || (BOOST_WORKAROUND(__GNUC__, == 4) && __GNUC_MINOR__ <= 2)
                 /// INTERNAL ONLY
- template<typename OtherTag, typename OtherValue = key_not_found>
+ struct found
+ {
+ typedef Value type;
+ typedef typename add_reference<typename add_const<Value>::type>::type const_reference;
+ };
+
+ template<typename OtherKey, typename OtherValue = key_not_found>
                 struct lookup
- : Base::template lookup<OtherTag, OtherValue>
+ : mpl::if_c<
+ is_same<OtherKey, Key>::value
+ , found
+ , typename Base::template lookup<OtherKey, OtherValue>
+ >::type
+ {};
+ #else
+ /// INTERNAL ONLY
+ template<typename OtherKey, typename OtherValue = key_not_found>
+ struct lookup
+ : Base::template lookup<OtherKey, OtherValue>
                 {};
 
                 /// INTERNAL ONLY
@@ -123,6 +142,7 @@
                     typedef Value type;
                     typedef typename add_reference<typename add_const<Value>::type>::type const_reference;
                 };
+ #endif
 
                 // For key-based lookups not intended to fail
                 using Base::operator[];

Modified: trunk/boost/proto/transform/make.hpp
==============================================================================
--- trunk/boost/proto/transform/make.hpp (original)
+++ trunk/boost/proto/transform/make.hpp 2012-08-08 03:01:36 EDT (Wed, 08 Aug 2012)
@@ -100,7 +100,7 @@
             static bool const applied = true;
         };
 
- #if BOOST_WORKAROUND(__GNUC__, == 3) || (__GNUC__ == 4 && __GNUC_MINOR__ == 0)
+ #if BOOST_WORKAROUND(__GNUC__, == 3) || (BOOST_WORKAROUND(__GNUC__, == 4) && __GNUC_MINOR__ == 0)
         // work around GCC bug
         template<typename Tag, typename Args, long N, typename Expr, typename State, typename Data>
         struct make_if_<proto::expr<Tag, Args, N>, Expr, State, Data, false>


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