Imported Upstream version 1.57.0
[platform/upstream/boost.git] / libs / type_index / patched / boost_function.patch
1 From 6f71069e85fab36d9b95d53ddb6d80b8d1bdb6b0 Mon Sep 17 00:00:00 2001
2 From: Antony Polukhin <antoshkka@gmail.com>
3 Date: Thu, 20 Feb 2014 18:33:20 +0400
4 Subject: [PATCH] Use TypeIndex in Boost.Function to remove duplicate code and
5  improve code performance
6
7 ---
8  include/boost/function/function_base.hpp | 22 +---------------------
9  test/Jamfile.v2                          |  2 ++
10  2 files changed, 3 insertions(+), 21 deletions(-)
11
12 diff --git a/include/boost/function/function_base.hpp b/include/boost/function/function_base.hpp
13 index f3663d7..8fd2c8d 100644
14 --- a/include/boost/function/function_base.hpp
15 +++ b/include/boost/function/function_base.hpp
16 @@ -44,27 +44,7 @@
17  #   pragma warning( disable : 4127 ) // "conditional expression is constant"
18  #endif       
19  
20 -// Define BOOST_FUNCTION_STD_NS to the namespace that contains type_info.
21 -#ifdef BOOST_NO_STD_TYPEINFO
22 -// Embedded VC++ does not have type_info in namespace std
23 -#  define BOOST_FUNCTION_STD_NS
24 -#else
25 -#  define BOOST_FUNCTION_STD_NS std
26 -#endif
27 -
28 -// Borrowed from Boost.Python library: determines the cases where we
29 -// need to use std::type_info::name to compare instead of operator==.
30 -#if defined( BOOST_NO_TYPEID )
31 -#  define BOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) ((X)==(Y))
32 -#elif defined(__GNUC__) \
33 - || defined(_AIX) \
34 - || (   defined(__sgi) && defined(__host_mips))
35 -#  include <cstring>
36 -#  define BOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) \
37 -     (std::strcmp((X).name(),(Y).name()) == 0)
38 -# else
39 -#  define BOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) ((X)==(Y))
40 -#endif
41 +#define BOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) (boost::typeind::type_index((X))==(Y))
42  
43  #if defined(__ICL) && __ICL <= 600 || defined(__MWERKS__) && __MWERKS__ < 0x2406 && !defined(BOOST_STRICT_CONFIG)
44  #  define BOOST_FUNCTION_TARGET_FIX(x) x
45 diff --git a/test/Jamfile.v2 b/test/Jamfile.v2
46 index 68895fa..12a00db 100644
47 --- a/test/Jamfile.v2
48 +++ b/test/Jamfile.v2
49 @@ -21,6 +21,8 @@ import testing ;
50      : 
51    [ run libs/function/test/function_test.cpp :  :  :  : lib_function_test ]
52  
53 +  [ run libs/function/test/function_test.cpp :  :  : <rtti>off : lib_function_test_no_rtti ]
54 +
55    [ run libs/function/test/function_n_test.cpp :  :  :  :  ]
56  
57    [ run libs/function/test/allocator_test.cpp ../../../libs/test/build//boost_test_exec_monitor :  :  :  :  ]
58 -- 
59 1.8.5.3
60