|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r77940 - in trunk: boost/functional boost/functional/overloaded_function/detail libs/functional/overloaded_function/test libs/local_function/example libs/local_function/test libs/scope_exit/example libs/scope_exit/test
From: lorcaminiti_at_[hidden]
Date: 2012-04-12 17:12:30
Author: lcaminiti
Date: 2012-04-12 17:12:28 EDT (Thu, 12 Apr 2012)
New Revision: 77940
URL: http://svn.boost.org/trac/boost/changeset/77940
Log:
Forcing type-of emulation on Sun.
Trying to fix OverloadedFunction pp bug on Sun by removing SUB on iteration range (doing ADD on iteration index instead).
Text files modified:
trunk/boost/functional/overloaded_function.hpp | 17 ++++++++---------
trunk/boost/functional/overloaded_function/detail/base.hpp | 4 +---
trunk/boost/functional/overloaded_function/detail/function_type.hpp | 2 +-
trunk/libs/functional/overloaded_function/test/Jamfile.v2 | 3 +++
trunk/libs/functional/overloaded_function/test/identity.hpp | 2 +-
trunk/libs/local_function/example/Jamfile.v2 | 3 +++
trunk/libs/local_function/test/Jamfile.v2 | 4 ++--
trunk/libs/scope_exit/example/Jamfile.v2 | 3 +++
trunk/libs/scope_exit/test/Jamfile.v2 | 35 +++++++++++++----------------------
9 files changed, 35 insertions(+), 38 deletions(-)
Modified: trunk/boost/functional/overloaded_function.hpp
==============================================================================
--- trunk/boost/functional/overloaded_function.hpp (original)
+++ trunk/boost/functional/overloaded_function.hpp 2012-04-12 17:12:28 EDT (Thu, 12 Apr 2012)
@@ -24,6 +24,7 @@
# include <boost/preprocessor/comparison/less.hpp>
# include <boost/preprocessor/cat.hpp>
# include <boost/preprocessor/arithmetic/add.hpp>
+# include <boost/preprocessor/arithmetic/sub.hpp>
# include <boost/preprocessor/tuple/eat.hpp>
# include <boost/preprocessor/logical/and.hpp>
# include <boost/preprocessor/logical/not.hpp>
@@ -82,14 +83,10 @@
BOOST_FUNCTIONAL_f_type(z, n, ~) \
>::type
-// Iterate within namespace.
-# define BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_OVERLOAD_COUNT \
- /*at least 2 func to overload 2, 3, ...*/ \
- BOOST_PP_SUB( \
- BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX, \
- 2)
# define BOOST_PP_ITERATION_PARAMS_1 \
- (3, (0, BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_OVERLOAD_COUNT, \
+ /* at least 2 func to overload so start from 2 to MAX */ \
+ /* (cannot iterate [0, MAX-2) because error on Sun) */ \
+ (3, (2, BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX, \
"boost/functional/overloaded_function.hpp"))
# include BOOST_PP_ITERATE() // Iterate over function arity.
@@ -113,8 +110,10 @@
#elif BOOST_PP_ITERATION_DEPTH() == 1
# define BOOST_FUNCTIONAL_overloads \
/* iterate as OVERLOADS, OVERLOADS-1, OVERLOADS-2, ... */ \
- BOOST_PP_SUB(BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX, \
- BOOST_PP_FRAME_ITERATION(1))
+ /* (add 2 because iteration started from 2 to MAX) */ \
+ BOOST_PP_ADD(2, BOOST_PP_SUB( \
+ BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX, \
+ BOOST_PP_FRAME_ITERATION(1)))
# define BOOST_FUNCTIONAL_is_tspec \
/* if template specialization */ \
BOOST_PP_LESS(BOOST_FUNCTIONAL_overloads, \
Modified: trunk/boost/functional/overloaded_function/detail/base.hpp
==============================================================================
--- trunk/boost/functional/overloaded_function/detail/base.hpp (original)
+++ trunk/boost/functional/overloaded_function/detail/base.hpp 2012-04-12 17:12:28 EDT (Thu, 12 Apr 2012)
@@ -10,7 +10,7 @@
# define BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_DETAIL_BASE_HPP_
# include <boost/functional/overloaded_function/config.hpp>
-/**@todo# include <boost/function.hpp>*/
+# include <boost/function.hpp>
# include <boost/preprocessor/iteration/iterate.hpp>
# include <boost/preprocessor/repetition/enum.hpp>
# include <boost/preprocessor/cat.hpp>
@@ -39,12 +39,10 @@
template<typename F>
class base {}; // Empty template cannot be used directly (only its spec).
-/*@todo
# define BOOST_PP_ITERATION_PARAMS_1 \
(3, (0, BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX, \
"boost/functional/overloaded_function/detail/base.hpp"))
# include BOOST_PP_ITERATE() // Iterate over funciton arity.
-*/
} } // namespace
Modified: trunk/boost/functional/overloaded_function/detail/function_type.hpp
==============================================================================
--- trunk/boost/functional/overloaded_function/detail/function_type.hpp (original)
+++ trunk/boost/functional/overloaded_function/detail/function_type.hpp 2012-04-12 17:12:28 EDT (Thu, 12 Apr 2012)
@@ -16,7 +16,7 @@
#include <boost/function_types/result_type.hpp>
#include <boost/type_traits/remove_pointer.hpp>
#include <boost/type_traits/remove_reference.hpp>
-/** @todo #include <boost/function.hpp>*/
+#include <boost/function.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/mpl/pop_front.hpp>
Modified: trunk/libs/functional/overloaded_function/test/Jamfile.v2
==============================================================================
--- trunk/libs/functional/overloaded_function/test/Jamfile.v2 (original)
+++ trunk/libs/functional/overloaded_function/test/Jamfile.v2 2012-04-12 17:12:28 EDT (Thu, 12 Apr 2012)
@@ -7,6 +7,9 @@
import testing ;
+# Sun does not automatically detect type-of emulation (force it).
+project : requirements <toolset>sun:<define>BOOST_TYPEOF_EMULATION ;
+
run functor.cpp ;
run make_decl.cpp ;
run make_call.cpp ;
Modified: trunk/libs/functional/overloaded_function/test/identity.hpp
==============================================================================
--- trunk/libs/functional/overloaded_function/test/identity.hpp (original)
+++ trunk/libs/functional/overloaded_function/test/identity.hpp 2012-04-12 17:12:28 EDT (Thu, 12 Apr 2012)
@@ -8,10 +8,10 @@
#ifndef IDENTITY_HPP_
#define IDENTITY_HPP_
-/** @todo #include <boost/function.hpp> */
//[identity_typeof
#include <boost/typeof/std/string.hpp> // No need to register `boost::function`.
//]
+#include <boost/function.hpp>
#include <string>
//[identity_decls
Modified: trunk/libs/local_function/example/Jamfile.v2
==============================================================================
--- trunk/libs/local_function/example/Jamfile.v2 (original)
+++ trunk/libs/local_function/example/Jamfile.v2 2012-04-12 17:12:28 EDT (Thu, 12 Apr 2012)
@@ -7,6 +7,9 @@
import testing ;
+# Sun does not automatically detect type-of emulation mode (force it).
+project : requirements <toolset>sun:<define>BOOST_TYPEOF_EMULATION ;
+
run add_cxx11_lambda.cpp ;
run add_global_functor.cpp ;
run add_local_functor.cpp ;
Modified: trunk/libs/local_function/test/Jamfile.v2
==============================================================================
--- trunk/libs/local_function/test/Jamfile.v2 (original)
+++ trunk/libs/local_function/test/Jamfile.v2 2012-04-12 17:12:28 EDT (Thu, 12 Apr 2012)
@@ -7,8 +7,8 @@
import testing ;
-# Workaround a Boost.Config bug that causes Boost.Typeof to fail on Sun.
-project : requirements <toolset>sun:<define>__typeof__=__typeof__ ;
+# Sun does not automatically detect type-of emulation mode (force it).
+project : requirements <toolset>sun:<define>BOOST_TYPEOF_EMULATION ;
rule vaseq ( command target )
{
Modified: trunk/libs/scope_exit/example/Jamfile.v2
==============================================================================
--- trunk/libs/scope_exit/example/Jamfile.v2 (original)
+++ trunk/libs/scope_exit/example/Jamfile.v2 2012-04-12 17:12:28 EDT (Thu, 12 Apr 2012)
@@ -8,6 +8,9 @@
import testing ;
+# Sun does not automatically detect type-of emulation mode (force it).
+project : requirements <toolset>sun:<define>BOOST_TYPEOF_EMULATION ;
+
run try_catch.cpp ;
run try_catch_seq.cpp ;
run try_catch_seq_nova.cpp ;
Modified: trunk/libs/scope_exit/test/Jamfile.v2
==============================================================================
--- trunk/libs/scope_exit/test/Jamfile.v2 (original)
+++ trunk/libs/scope_exit/test/Jamfile.v2 2012-04-12 17:12:28 EDT (Thu, 12 Apr 2012)
@@ -8,24 +8,15 @@
import testing ;
-# Workaround a Boost.Config bug that causes Boost.Typeof to fail on Sun.
-project
- : requirements
- <toolset>sun:<define>__typeof__=__typeof__
- <toolset>sun:<cxxflags>"-Qoption ccfe -features=gcc"
- ;
-#project : requirements <toolset>sun:<define>typeof=__typeof__ ;
-#project : requirements <toolset>sun:<define>__typeof__=__typeof__ ;
-#project : requirements <toolset>sun:<cxxflags>"-Qoption ccfe -features=gcc" ;
-#project : requirements <toolset>gcc:<cxxflags>"-Wall -std=c++0x -Wall" ;
-
-rule vaseq ( command target )
+rule run-vaseq ( command target )
{
- $(command) $(target).cpp ;
- $(command) $(target)_seq.cpp ;
- $(command) $(target)_seq_nova.cpp ;
+ # Sun does not automatically detect type-of emulation mode (force it).
+ run $(target).cpp : : : <toolset>sun:<define>BOOST_TYPEOF_EMULATION ;
+ run $(target)_seq.cpp : : : <toolset>sun:<define>BOOST_TYPEOF_EMULATION ;
+ run $(target)_seq_nova.cpp : : :
+ <toolset>sun:<define>BOOST_TYPEOF_EMULATION ;
}
-
+
rule run-typeof ( native_target emulation_target )
{
run $(native_target).cpp : : : <define>BOOST_TYPEOF_NATIVE ;
@@ -40,12 +31,12 @@
$(emulation_target) : ;
}
-vaseq run same_line ;
-vaseq run world ;
-vaseq run world_checkpoint ;
-vaseq run world_checkpoint_all ;
-vaseq run world_this ;
-vaseq run world_tpl ;
+run-vaseq run same_line ;
+run-vaseq run world ;
+run-vaseq run world_checkpoint ;
+run-vaseq run world_checkpoint_all ;
+run-vaseq run world_this ;
+run-vaseq run world_tpl ;
run world_void.cpp ;
run world_void_nova.cpp ;
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