From 9e4e48a9b3e2d83b144d48e7c32c30b1f23553d0 Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Wed, 13 Nov 2013 10:35:20 +0400 Subject: [PATCH] Applied first portion of fixes, proposed by Vicente J. Botet Escriba --- boost/type_index/type_index.hpp | 6 +++--- boost/type_index/type_info.hpp | 16 ++++++++-------- libs/type_index/doc/type_index.qbk | 2 +- libs/type_index/test/Jamfile.v2 | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/boost/type_index/type_index.hpp b/boost/type_index/type_index.hpp index 3a92198..df3f76c 100644 --- a/boost/type_index/type_index.hpp +++ b/boost/type_index/type_index.hpp @@ -26,7 +26,7 @@ #include // MSVC is capable of calling typeid(T) even when RTTI is off -#if (!defined(BOOST_NO_RTTI) && !defined(BOOST_TYPE_INDEX_FORCE_NORTTI_COMPATIBILITY)) || defined(BOOST_MSVC) +#if (!defined(BOOST_NO_RTTI) && !defined(BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY)) || defined(BOOST_MSVC) #if !defined(BOOST_NO_IOSTREAM) #if !defined(BOOST_NO_IOSFWD) @@ -206,7 +206,7 @@ inline std::size_t hash_value(type_index const& v) BOOST_NOEXCEPT { } // namespace boost -#else // (!defined(BOOST_NO_RTTI) && !defined(BOOST_TYPE_INDEX_FORCE_NORTTI_COMPATIBILITY)) || defined(BOOST_MSVC) +#else // (!defined(BOOST_NO_RTTI) && !defined(BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY)) || defined(BOOST_MSVC) #include namespace boost { @@ -215,7 +215,7 @@ typedef template_index type_index; } -#endif // (!defined(BOOST_NO_RTTI) && !defined(BOOST_TYPE_INDEX_FORCE_NORTTI_COMPATIBILITY)) || defined(BOOST_MSVC) +#endif // (!defined(BOOST_NO_RTTI) && !defined(BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY)) || defined(BOOST_MSVC) #endif // BOOST_TYPE_INDEX_TYPE_INDEX_HPP diff --git a/boost/type_index/type_info.hpp b/boost/type_index/type_info.hpp index 410e3c4..2f3b319 100644 --- a/boost/type_index/type_info.hpp +++ b/boost/type_index/type_info.hpp @@ -21,7 +21,7 @@ /// this class has a name_demangled() function for getting human-readable type names. /// /// boost::type_info class is used in situations when RTTI is enabled. -/// When RTTI is disabled or BOOST_TYPE_INDEX_FORCE_NORTTI_COMPATIBILITY macro is defined boost::template_info +/// When RTTI is disabled or BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY macro is defined boost::template_info /// is usually used instead of it (some compilers allow calling typeid(T) /// even if RTTI is disabled, those copilers will continue to use boost::type_info class). @@ -29,7 +29,7 @@ // MSVC is capable of calling typeid(T) even when RTTI is off -#if (!defined(BOOST_NO_RTTI) && !defined(BOOST_TYPE_INDEX_FORCE_NORTTI_COMPATIBILITY)) || defined(BOOST_MSVC) +#if (!defined(BOOST_NO_RTTI) && !defined(BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY)) || defined(BOOST_MSVC) #include #include @@ -81,7 +81,7 @@ namespace detail { /// boost::type_info is a class that can be used as a drop-in replacement for std::type_info. /// /// boost::type_info class is used in situations when RTTI is enabled. -/// When RTTI is disabled or BOOST_TYPE_INDEX_FORCE_NORTTI_COMPATIBILITY macro is defined boost::template_info +/// When RTTI is disabled or BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY macro is defined boost::template_info /// is used instead of it. /// /// Unlike std::type_info this class: @@ -319,7 +319,7 @@ inline std::size_t hash_value(type_info const& v) BOOST_NOEXCEPT { } // namespace boost -#else // !defined(BOOST_NO_RTTI) && !defined(BOOST_TYPE_INDEX_FORCE_NORTTI_COMPATIBILITY) +#else // !defined(BOOST_NO_RTTI) && !defined(BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY) # include # include @@ -351,14 +351,14 @@ inline const type_info& type_id_rtti_only(T* rtti_val) { } // namespace boost -#endif // (!defined(BOOST_NO_RTTI) && !defined(BOOST_TYPE_INDEX_FORCE_NORTTI_COMPATIBILITY)) || defined (BOOST_MSVC) +#endif // (!defined(BOOST_NO_RTTI) && !defined(BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY)) || defined (BOOST_MSVC) #if defined(BOOST_TYPE_INDEX_DOXYGEN_INVOKED) -/// \def BOOST_TYPE_INDEX_FORCE_NORTTI_COMPATIBILITY -/// Define the BOOST_TYPE_INDEX_FORCE_NORTTI_COMPATIBILITY macro if you are mixing objects +/// \def BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY +/// Define the BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY macro if you are mixing objects /// compiled with different RTTI flags. This will force the usage of boost::template_index /// class instead of boost::type_index. -#define BOOST_TYPE_INDEX_FORCE_NORTTI_COMPATIBILITY +#define BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY #endif // BOOST_TYPE_INDEX_DOXYGEN_INVOKED #endif // BOOST_TYPE_INDEX_TYPE_INFO_HPP diff --git a/libs/type_index/doc/type_index.qbk b/libs/type_index/doc/type_index.qbk index 8f5ee93..692bb25 100644 --- a/libs/type_index/doc/type_index.qbk +++ b/libs/type_index/doc/type_index.qbk @@ -30,7 +30,7 @@ Boost.TypeIndex library was designed to work around all those issues. [section Getting started] -`boost::type_info` is a drop-in replacement for `std::type_index` and `boost::type_index` is a drop-in +`boost::type_info` is a drop-in replacement for `std::type_info` and `boost::type_index` is a drop-in replacement for `std::type_index`. Unlike Standard Library versions those classes may work without RTTI. `boost::type_index` provides the full set of comparison operators, hashing functions and ostream diff --git a/libs/type_index/test/Jamfile.v2 b/libs/type_index/test/Jamfile.v2 index c073638..6865544 100644 --- a/libs/type_index/test/Jamfile.v2 +++ b/libs/type_index/test/Jamfile.v2 @@ -12,7 +12,7 @@ import feature ; tlib = /boost/test//boost_unit_test_framework/static ; # Variable that contains all the stuff required for linking together on and off -compat = BOOST_TYPE_INDEX_FORCE_NORTTI_COMPATIBILITY ; +compat = BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY ; # Making own `nortti` that is link compatible nortti = gcc:-fno-rtti clang:-fno-rtti msvc:/GR- ;